bpmn-io / table-js

A blazing fast library for viewing and editing tables

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot type greater than sign '>' (AltGr + Y)

romero83 opened this issue · comments

Hi!

I found an issue in case of Hungarian keyboard layout (or can be other layout too).
When user would like to type greater than sign '>' (AltGr + Y) e.g. in DMN advanced mode, then it is not typing '>' instead redo function occurs.

The problem is that in some type of language keyboard layout there is an AltGr key which fires both altKey and ctrlKey (command key) in Javascript.

The bug located in lib/features/keyboard/Keyboard.js:205
Which looks like the following:

function isCmd(modifiers) {
  return modifiers.ctrlKey || modifiers.metaKey;
}

But it should look like this:

function isCmd(modifiers) {
  return !modifiers.altKey && (modifiers.ctrlKey || modifiers.metaKey);
}

Note:
I found several Keyboard module in different bpmn.io projects, so if you agree with the above solution then it should implement in those Keyboard modules also (or not) (or standardize Keyboard.js because it looks like code duplication).

Thank you,
Best regards,
Rómeó Nagy

Thanks for looking into that and proposing a fix already?

Do you mind adding a PR for this?

I am not so familiar with GitHub so it is up to you to accept and merge the above solution.

All right. We'll look into it. Thanks.