Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

fix: incorrect z-index of text editor (#2914)

David Luzare18e945cd31b
diff --git a/src/components/App.tsx b/src/components/App.tsx
index fcd0bd1572..fd6759fbed 100644
--- a/src/components/App.tsx
+++ b/src/components/App.tsx
@@ -454,6 +454,7 @@ class App extends React.Component<ExcalidrawProps, AppState> {
renderCustomFooter={renderFooter}
viewModeEnabled={viewModeEnabled}
/>
+ <div className="excalidraw-textEditorContainer" />
{this.state.showStats && (
<Stats
appState={this.state}
diff --git a/src/element/textWysiwyg.tsx b/src/element/textWysiwyg.tsx
index 2278ca1cec..c855766542 100644
--- a/src/element/textWysiwyg.tsx
+++ b/src/element/textWysiwyg.tsx
@@ -160,7 +160,7 @@ export const textWysiwyg = ({
unbindUpdate();
- document.body.removeChild(editable);
+ editable.remove();
};
const rebindBlur = () => {
@@ -206,7 +206,9 @@ export const textWysiwyg = ({
passive: false,
capture: true,
});
- document.body.appendChild(editable);
+ document
+ .querySelector(".excalidraw-textEditorContainer")!
+ .appendChild(editable);
editable.focus();
editable.select();
};