Skip to content
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

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

vsgoulart
Copy link
Contributor

@vsgoulart vsgoulart commented Sep 18, 2024

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

@bpmn-io-tasks bpmn-io-tasks bot added the in progress Currently worked on label Sep 18, 2024
@Skaiir Skaiir self-assigned this Oct 1, 2024
@Skaiir Skaiir force-pushed the new-diagram-js-binding branch 2 times, most recently from fe4d7ff to 89799a3 Compare October 2, 2024 12:55
@barmac
Copy link
Member

barmac commented Nov 15, 2024

Diagram-js@15 has been released. To support the migration, I will make sure this PR is mergable.

@barmac barmac force-pushed the new-diagram-js-binding branch 2 times, most recently from 1b8d8bd to 0eaa0f2 Compare November 15, 2024 13:06
@barmac barmac self-assigned this Nov 15, 2024
@barmac barmac changed the title refactor: use new diagram-js binding Add implicit keyboard binding / migrate to diagram-js@15 Nov 15, 2024
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
@barmac barmac marked this pull request as ready for review November 15, 2024 13:32
@bpmn-io-tasks bpmn-io-tasks bot added needs review Review pending and removed in progress Currently worked on labels Nov 15, 2024
@barmac barmac requested a review from a team November 15, 2024 13:32
@barmac
Copy link
Member

barmac commented Nov 15, 2024

Ready to review @Skaiir @vsgoulart

@barmac barmac requested review from a team and Skaiir and removed request for a team November 15, 2024 13:33
Copy link
Contributor Author

@vsgoulart vsgoulart left a 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

@barmac
Copy link
Member

barmac commented Nov 15, 2024

Since I am only contributing here, please merge when you're ready.

Copy link
Contributor

@Skaiir Skaiir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@vsgoulart vsgoulart merged commit 4566125 into develop Nov 18, 2024
14 of 15 checks passed
@vsgoulart vsgoulart deleted the new-diagram-js-binding branch November 18, 2024 09:54
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Nov 18, 2024

// focus container on over if no selection
container.addEventListener('mouseover', function () {
if (document.activeElement === document.body) {
Copy link
Member

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)) {
Copy link
Member

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.

@nikku
Copy link
Member

nikku commented Nov 19, 2024

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?

@barmac
Copy link
Member

barmac commented Nov 19, 2024

Indeed, there is no canvas in form-js :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants