fix(save-markdown-modal): use createPortal to render at document body

Fixes overlay not covering sidebar and file panel by rendering the
modal via React portal to document.body, ensuring proper z-index
stacking across all UI layers.
This commit is contained in:
Pedram Amini
2026-02-01 19:49:27 -06:00
parent f9db845712
commit 9e83588ffd

View File

@@ -8,6 +8,7 @@
*/
import React, { useState, useRef, useEffect } from 'react';
import { createPortal } from 'react-dom';
import { FolderOpen } from 'lucide-react';
import type { Theme } from '../types';
import { Modal, ModalFooter } from './ui/Modal';
@@ -99,7 +100,7 @@ export function SaveMarkdownModal({
const isValid = folder.trim() && filename.trim();
return (
return createPortal(
<Modal
theme={theme}
title="Save Markdown"
@@ -195,7 +196,8 @@ export function SaveMarkdownModal({
</p>
)}
</div>
</Modal>
</Modal>,
document.body
);
}