Skip to content

Commit

Permalink
ELEMENTS-1676: Backport - Make actions at the bottom of a nuxeo-data-…
Browse files Browse the repository at this point in the history
…grid card usable with keyboard only
  • Loading branch information
swarnadipa-dev committed Sep 27, 2023
1 parent 779dd38 commit f6e9218
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ui/actions/nuxeo-download-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import '../nuxeo-button-styles.js';
<dom-if if="[[_isAvailable(document)]]">
<template>
<div class="action" on-click="_download" tabindex="0">
<div class="action" on-click="_download" tabindex="-1">
<paper-icon-button
icon="[[icon]]"
noink
Expand Down Expand Up @@ -107,6 +107,15 @@ import '../nuxeo-button-styles.js';
};
}

ready() {
super.ready();
this.addEventListener('keydown', (event) => {
if (event.key === 'Enter') {
event.stopPropagation();
}
});
}

_isAvailable(doc) {
return this.hasContent(doc, this.formatPropertyXpath(this.xpath));
}
Expand Down

0 comments on commit f6e9218

Please sign in to comment.