mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
Text esc fixes (#925)
* fix incorrectly resetting state on esc * confirm text on esc
This commit is contained in:
parent
3a5ca27600
commit
f0e6f4dbb8
2 changed files with 2 additions and 7 deletions
|
@ -47,6 +47,7 @@ export const actionFinalize = register({
|
||||||
: "selection",
|
: "selection",
|
||||||
draggingElement: null,
|
draggingElement: null,
|
||||||
multiElement: null,
|
multiElement: null,
|
||||||
|
editingElement: null,
|
||||||
selectedElementIds: {},
|
selectedElementIds: {},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -92,13 +92,7 @@ export function textWysiwyg({
|
||||||
editable.onkeydown = ev => {
|
editable.onkeydown = ev => {
|
||||||
if (ev.key === KEYS.ESCAPE) {
|
if (ev.key === KEYS.ESCAPE) {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
if (initText) {
|
|
||||||
editable.innerText = initText;
|
|
||||||
handleSubmit();
|
handleSubmit();
|
||||||
return;
|
|
||||||
}
|
|
||||||
cleanup();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (ev.key === KEYS.ENTER && !ev.shiftKey) {
|
if (ev.key === KEYS.ENTER && !ev.shiftKey) {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
|
|
Loading…
Add table
Reference in a new issue