fin-hypergrid / core

A canvas-based super high performant grid renderer API
MIT License
897 stars 144 forks source link

Hypergrid mouse events have outdated `keys` #769

Closed joneit closed 6 years ago

joneit commented 6 years ago

UI issue reported by @Revathigb diagnosed as follows:

The grid.canvas.currentKeys array is fossilized at last key event received by canvas when it last had focus. When accessed later, some key modifiers may no longer be in the same as they were (e.g., when keys went up or down while canvas blurred).

A reference to grid.canvas.currentKeys is passed to mouse event handlers as e.detail.keys and a copy of this array is passed to keyboard event handlers as e.detail.currentKeys.

These properties need to be getters that update grid.canvas.currentKeys with modifier key states reported in the current mouse event before returning the reference or copy.

joneit commented 6 years ago

The getters are implemented in PR #762 and will be released in version 3.1.0.

Note that they all now return a copy (rather than a reference) to grid.canvas.currentKeys.