mirror of
				https://github.com/excalidraw/excalidraw.git
				synced 2025-10-31 10:54:33 +01:00 
			
		
		
		
	fix hotkeys not working when non-writable input focused (#717)
This commit is contained in:
		| @@ -387,7 +387,11 @@ export class App extends React.Component<any, AppState> { | ||||
|   }; | ||||
|  | ||||
|   private onKeyDown = (event: KeyboardEvent) => { | ||||
|     if (isInputLike(event.target) && event.key !== KEYS.ESCAPE) { | ||||
|     if ( | ||||
|       (isWritableElement(event.target) && event.key !== KEYS.ESCAPE) || | ||||
|       // case: using arrows to move between buttons | ||||
|       (isArrowKey(event.key) && isInputLike(event.target)) | ||||
|     ) { | ||||
|       return; | ||||
|     } | ||||
|  | ||||
| @@ -438,6 +442,9 @@ export class App extends React.Component<any, AppState> { | ||||
|       if (!isHoldingSpace) { | ||||
|         setCursorForShape(shape); | ||||
|       } | ||||
|       if (document.activeElement instanceof HTMLElement) { | ||||
|         document.activeElement.blur(); | ||||
|       } | ||||
|       elements = clearSelection(elements); | ||||
|       this.setState({ elementType: shape }); | ||||
|       // Undo action | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 David Luzar
					David Luzar