-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix Safari responds to the EnterKey from IM #2901
Conversation
eae882c
to
27685bf
Compare
@@ -181,7 +181,8 @@ export class EditPlugin implements EditorPlugin { | |||
break; | |||
|
|||
case 'Enter': | |||
if (!hasCtrlOrMetaKey) { | |||
if (!hasCtrlOrMetaKey && event.rawEvent.keyCode == 13) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. If we are sure that keyCode will be 229 for IME enter, I prefer to check keyCode != 229 here which makes it more clear what it is doing.
Please add a const declaration for this key name and add comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
I created a PR to fix it from core plugin. #2905 |
/** | ||
* Key code enumeration | ||
*/ | ||
export const enum KeyCode { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just put it back in EditPlugin.ts and no need to export it.
And use a regular const instead of const enum since const enum has a lot of problem.
6d432a7
to
3e908c1
Compare
How to repro: Press Enter when IM shows candidates
Screen.Recording.2024-12-09.at.13.14.33.mov
And its keycode is 229
Which is dead code