open-consul/ui-v2/app/components/tab-nav.js
John Cowen 9dc83806d8
ui: Keyboard navigation improvements (#7090)
* ui: Improve keyboard access for some custom components

* ui: Add some accessibility related metadata
2020-01-20 14:15:15 +00:00

15 lines
279 B
JavaScript

import Component from '@ember/component';
const ENTER = 13;
export default Component.extend({
name: 'tab',
tagName: '',
actions: {
keydown: function(e) {
if (e.keyCode === ENTER) {
e.target.dispatchEvent(new MouseEvent('click'));
}
},
},
});