-
Notifications
You must be signed in to change notification settings - Fork 108
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
Add implicit keyboard binding / migrate to diagram-js@15 #1269
Conversation
fe4d7ff
to
89799a3
Compare
Diagram-js@15 has been released. To support the migration, I will make sure this PR is mergable. |
1b8d8bd
to
0eaa0f2
Compare
0eaa0f2
to
45df343
Compare
45df343
to
6cd54a9
Compare
This updates the library to diagram-js@15 which ships breaking changes. BREAKING CHANGES: * Keyboard is now implicitly bound to the container element. Calls to `keyboard.bind` with `node` and `keyboard.bindTo` now result with a descriptive console error and have no effect. Related to bpmn-io/diagram-js#662
6cd54a9
to
f04edca
Compare
Ready to review @Skaiir @vsgoulart |
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.
@barmac I can't approve it because I created the PR, but it looks good to me.
Together with the tests we did before I couldn't break it
Since I am only contributing here, please merge when you're ready. |
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.
👍
|
||
// focus container on over if no selection | ||
container.addEventListener('mouseover', function () { | ||
if (document.activeElement === document.body) { |
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.
We could / should use Canvas#restoreFocus()
here.
// inside; this follows input focus handling closely | ||
container.addEventListener('click', function (event) { | ||
// force focus when clicking container | ||
if (!container.contains(document.activeElement)) { |
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.
We could / should use Canvas#restoreFocus()
here.
I could not not break it either, and the integration speaks to the simplicity of this thing. Great job 👏 Added two comments #1269 (comment), we probably cannot follow up on those, as we don't use the canvas, right? |
Indeed, there is no canvas in form-js :( |
This updates the library to diagram-js@15 which ships breaking changes.
BREAKING CHANGES:
Calls to
keyboard.bind
withnode
andkeyboard.bindTo
now result with a descriptive console error and have no effect.
Related to bpmn-io/diagram-js#662