fix: deselect on escape only if neither dragging nor finalizing an action

This commit is contained in:
Andrew Aquino 2024-04-03 16:06:23 -07:00
parent db9aca37b6
commit 63e748f147

View file

@ -3748,11 +3748,16 @@ class App extends React.Component<AppProps, AppState> {
} }
// remove selections on escape press // remove selections on escape press
if (event.key === KEYS.ESCAPE) { if (
// Don't deselect text right after editing it event.key === KEYS.ESCAPE &&
if (isWritableElement(event.target)) { // unless we're dragging or finalizing an action
return; !(
} this.state.draggingElement ||
isWritableElement(event.target) ||
this.state.editingElement ||
["freedraw", "eraser"].includes(this.state.activeTool.type)
)
) {
this.setState({ this.setState({
selectedElementIds: {}, selectedElementIds: {},
selectedGroupIds: {}, selectedGroupIds: {},