mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: cmd/ctrl native browser behavior blocked in inputs (#4589)
* fix: cmd/ctrl native browser behavior blocked in inputs * add basic test for fontSize increase/decrease via keyboard * add tests for fontSize resizing via keyboard outside wysiwyg * Update src/element/textWysiwyg.test.tsx Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com> * Update src/tests/resize.test.tsx Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com> * Update src/tests/resize.test.tsx Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com> Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
This commit is contained in:
parent
dba71e358d
commit
1fd2fe56ee
6 changed files with 83 additions and 17 deletions
|
@ -1649,10 +1649,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||
}
|
||||
|
||||
if (
|
||||
(isWritableElement(event.target) &&
|
||||
event.key !== KEYS.ESCAPE &&
|
||||
// handle cmd/ctrl-modifier shortcuts even inside inputs
|
||||
!event[KEYS.CTRL_OR_CMD]) ||
|
||||
(isWritableElement(event.target) && event.key !== KEYS.ESCAPE) ||
|
||||
// case: using arrows to move between buttons
|
||||
(isArrowKey(event.key) && isInputLike(event.target))
|
||||
) {
|
||||
|
@ -1993,6 +1990,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||
}),
|
||||
element,
|
||||
excalidrawContainer: this.excalidrawContainerRef.current,
|
||||
app: this,
|
||||
});
|
||||
// deselect all other elements when inserting text
|
||||
this.deselectElements();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue