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

feat(keyboard): specify which keys are handled #573

Merged
merged 1 commit into from
Oct 13, 2021

Conversation

marstamm
Copy link
Contributor

@marstamm marstamm commented Oct 12, 2021

Allow inputs to define which modifier keys should be handled by the application vs. the browser.

This reverts #564 and replaces it with a fine-grained utility to opt-into processing of input-triggered keyboard events.

To react to a CTRL/CMD+ shortcut the input triggering it must be wrapped in a [input-handle-modified-keys] directive like so:

<div input-handle-modified-keys="z,y">
  <input></input>
</div>

Check bpmn-io/bpmn-properties-panel#135 for usage in the properties panel.


Related to bpmn-io/bpmn-js#1493

@bpmn-io-tasks bpmn-io-tasks bot added the in progress Currently worked on label Oct 12, 2021
@marstamm marstamm force-pushed the whitelist-modifier-keys branch 2 times, most recently from 56f29f1 to 253dc34 Compare October 12, 2021 09:59
@marstamm marstamm force-pushed the whitelist-modifier-keys branch from 253dc34 to 7e2802a Compare October 12, 2021 11:17
@marstamm marstamm marked this pull request as ready for review October 12, 2021 11:20
@bpmn-io-tasks bpmn-io-tasks bot added needs review Review pending and removed in progress Currently worked on labels Oct 12, 2021
@marstamm marstamm requested review from a team, pinussilvestrus and MaxTru and removed request for a team October 12, 2021 11:20
@nikku nikku force-pushed the whitelist-modifier-keys branch 2 times, most recently from 0daa945 to f9ff2d3 Compare October 13, 2021 10:35
Copy link
Member

@nikku nikku left a comment

Choose a reason for hiding this comment

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

Nice one.

This reverts #564
and replaces it with a fine-grained utility to opt-into processing
of input-triggered keyboard events.

To react to a `CTRL/CMD+` shortcut the input triggering it must
be wrapped in a `[input-handle-modified-keys]` directive like so:

```html
<div input-handle-modified-keys="z,y">
  <input></input>
</div>
```

Related to bpmn-io/bpmn-js#1493
@nikku nikku merged commit c744a4f into develop Oct 13, 2021
@nikku nikku deleted the whitelist-modifier-keys branch October 13, 2021 11:01
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Oct 13, 2021
@nikku
Copy link
Member

nikku commented Oct 13, 2021

Follow-up tasks:

  • release as minor
  • integrate into form-js
  • integrate into bpmn-js-properties-panel and bpmn-properties-panel
  • integrate into dmn-js-properties-panel
  • integrate into dmn-js-drd ID editor

@marstamm
Copy link
Contributor Author

integrate into dmn-js-drd ID editor

I will not integrate it into this editor at this point, as it has unexpected UI effects. The cursor position is reset when we don't use the browser defaults:
recording

@nikku
Copy link
Member

nikku commented Oct 14, 2021

@marstamm Makes sense. Let us wait for the first user to find this and report ⌛

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.

2 participants