DevExtreme React - Keyboard Support

An end user can use the following keys to interact with the widget.

Key Action
↑ / ↓ Scrolls the content up/down if the scrolling direction is "vertical" or "both".
Mouse Wheel + Shift or ← / → Scrolls the content left/right if the scrolling direction is "horizontal" or "both".
Page Up / Page Down Scrolls the content up/down by a whole page.
Home / End Scrolls the content to the top/bottom.

You can implement a custom handler for a key using the registerKeyHandler(key, handler) method.

JavaScript
  • function registerKeyHandlers () {
  • let scrollView = $("#scrollViewContainer").dxScrollView("instance");
  • scrollView.registerKeyHandler("backspace", function (e) {
  • // The argument "e" contains information on the event
  • });
  • scrollView.registerKeyHandler("space", function (e) {
  • // ...
  • });
  • }
See Also