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

This commit is contained in:
David Luzar 2021-02-04 14:54:00 +01:00 committed by GitHub
parent bd0c6e63ff
commit e18e945cd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -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}

View File

@ -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();
};