-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix an issue when call onKeyUp handler in PickerPlugin (#297)
* Check isSuggesting for function key in PickerPlugin * 7.3.2 * Fix emoji reappear issue when space after backspace
- Loading branch information
1 parent
6476fad
commit 61bd201
Showing
7 changed files
with
47 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
packages/roosterjs-editor-core/lib/eventApi/isCharacterValue.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import isModifierKey from './isModifierKey'; | ||
|
||
/** | ||
* Returns true when the event was fired from a key that produces a character value, otherwise false | ||
* This detection is not 100% accurate. event.key is not fully supported by all browsers, and in some browsers (e.g. IE), | ||
* event.key is longer than 1 for num pad input. But here we just want to improve performance as much as possible. | ||
* So if we missed some case here it is still acceptable. | ||
* @param event The keyboard event object | ||
*/ | ||
export default function isCharacterValue(event: KeyboardEvent): boolean { | ||
return !isModifierKey(event) && event.key && event.key.length == 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters