HotkeysProvider does not work properly when Table is rendered on the same page #4789
Closed
Description
Environment
- Package version(s): core 3.46.0, table 3.8.34
- Operating System: macOS
- Browser name and version: Chrome
Steps to reproduce
- Use HotkeysProvider, register some global hotkeys
- Render a Table on the same page
- Open the hotkeys dialog with "?"
Actual behavior
You get two dialogs open, one of them is empty (the one triggered by the old @HotkeysTarget
API, used in <Table>
).
You can even repro this in the documentation "Table features" page
Expected behavior
The two hotkeys APIs should not interfere
Possible solution
Converting Table to HotkeysTarget2 seems to work (despite some duplicate keys displayed), but we can’t introduce a breaking change to Table right now (requiring HotkeysProvider in place)... so we can either
- create a new Table2 component which uses HotkeysTarget2, or
- edit HotkeysEvents to not display the dialog if there are no hotkeys to show (this is a bit of a band-aid)
Since we’re going to need to migrate people to a new version of Table which uses new hotkeys anyway, we should probably make Table2...