Text esc fixes (#925)
* fix incorrectly resetting state on esc * confirm text on esc
This commit is contained in:
parent
3a5ca27600
commit
f0e6f4dbb8
@ -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) {
|
handleSubmit();
|
||||||
editable.innerText = initText;
|
|
||||||
handleSubmit();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
cleanup();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (ev.key === KEYS.ENTER && !ev.shiftKey) {
|
if (ev.key === KEYS.ENTER && !ev.shiftKey) {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user