mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: deselect on escape only if neither dragging nor finalizing an action
This commit is contained in:
parent
db9aca37b6
commit
63e748f147
1 changed files with 10 additions and 5 deletions
|
@ -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: {},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue