-
Notifications
You must be signed in to change notification settings - Fork 137
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
Prevent global keydown
event when ContentEditable
handled ENTER
#909
Conversation
ContentEditable
handled ENTER
keydown
event when ContentEditable
handled ENTER
Rebased on top of fixed CC @jarekdanielak. |
This fixes a regression introduced via a6dfc16. The prior change switched to `onKeyDown`, which is an synthetic event handler that cannot prevent default (on global clicks). What we need to prevent default (global) clicks is actual DOM event handling. Quoting from the Inferno documentation [1]: > Lower case events will bypass Inferno's event system in favour of > using the native event system supplied by the browser. [1]: https://www.infernojs.org/docs/guides/event-handling
I find it super confusing that Inferno supports both lowercase and camelcase event handlers. Anyway, thanks for fixing this! |
I've added comments which should save us some WTF in the future. |
I've prepared a PR aiming to fix the flaky test causing CI to fail: #910 |
This still works as expected. The comments are a valuable addition ✔️ |
Proposed Changes
This fixes a regression introduced via a6dfc16.
The prior change switched to
onKeyDown
, which is an synthetic event handler that cannot prevent default (on global clicks).What we need to prevent default (global) clicks is actual DOM event handling. Quoting from the Inferno documentation 1:
The fixed behavior can be inspected via
npm start
, using the Dish DecisionJavaScript
field, but also in the fact that the test suite passes (again):Checklist
To ensure you provided everything we need to look at your PR:
@bpmn-io/sr
toolCloses {LINK_TO_ISSUE}
orRelated to {LINK_TO_ISSUE}