We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd9ad69 commit e2c6615Copy full SHA for e2c6615
src/components/modebar/modebar.js
@@ -44,7 +44,18 @@ proto.update = function(graphInfo, buttons) {
44
45
this.element.setAttribute('id', modeBarId);
46
this.element.setAttribute('role', 'toolbar');
47
- this.element.setAttribute('tabindex', '0')
+ this.element.setAttribute('tabindex', '0');
48
+
49
+ this.element.addEventListener('keydown', function(e) {
50
+ if (e.key === 'Enter' || e.key === ' ') {
51
+ const activeButton = e.target.closest('.modebar-btn');
52
+ if (activeButton) {
53
+ activeButton.click();
54
+ e.preventDefault();
55
+ }
56
57
+ });
58
59
this._uid = modeBarId;
60
this.element.className = 'modebar modebar--custom';
61
if(context.displayModeBar === 'hover') this.element.className += ' modebar--hover ease-bg';
0 commit comments