Issue number of the reported bug or feature request: #203
Describe your changes
Added an ipydatagrid-specific KeyHandler class to control the behaviour of keydown events. This allows us to address the issue where users cannot enter command mode on notebooks due to events being intercepted in the hierarchy above the ipydatagrid canvas. The new behaviour for an Escape key press event is as follows:
If selections exist on the grid, clear those but stay focused on the grid so that the user can keep using keyboard shortcuts to control the grid, should they wish to do so.
If no selections exist on the grid, yield focus to the body tag on the page. Command mode will then be available.
Testing performed
Tested working as expected on both JupyterLab3 and Jupyter Notebook
Issue number of the reported bug or feature request: #203
Describe your changes Added an
ipydatagrid
-specific KeyHandler class to control the behaviour ofkeydown
events. This allows us to address the issue where users cannot enter command mode on notebooks due to events being intercepted in the hierarchy above theipydatagrid
canvas. The new behaviour for an Escape key press event is as follows:body
tag on the page. Command mode will then be available.Testing performed Tested working as expected on both JupyterLab3 and Jupyter Notebook
Additional context No additional context.