Skip to content

Commit 5176954

Browse files
authored
fix(ui5-li): remove “delete” button from tab chain(#3290)
"Delete" button should not be part of tab chain. It should be accessed only with mouse. Fixes: #2964
1 parent 67913d3 commit 5176954

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

packages/base/src/util/TabbableElements.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const getTabbables = (nodes, tabbables) => {
1717
}
1818

1919
Array.from(nodes).forEach(currentNode => {
20-
if (currentNode.nodeType === Node.TEXT_NODE || currentNode.nodeType === Node.COMMENT_NODE) {
20+
if (currentNode.nodeType === Node.TEXT_NODE || currentNode.nodeType === Node.COMMENT_NODE || currentNode.hasAttribute("data-sap-no-tab-ref")) {
2121
return;
2222
}
2323

packages/base/src/util/isNodeTabbable.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ const isNodeTabbable = node => {
1515
return false;
1616
}
1717

18-
if (nodeName === "a" || /input|select|textarea|button|object/.test(nodeName)) {
19-
return !node.disabled;
20-
}
21-
2218
const tabIndex = node.getAttribute("tabindex");
2319
if (tabIndex !== null && tabIndex !== undefined) {
2420
return parseInt(tabIndex) >= 0;
2521
}
22+
23+
if (nodeName === "a" || /input|select|textarea|button|object/.test(nodeName)) {
24+
return !node.disabled;
25+
}
2626
};
2727

2828
export default isNodeTabbable;

packages/main/src/ListItem.hbs

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
<div class="ui5-li-deletebtn">
8686
<ui5-button
8787
tabindex="-1"
88+
data-sap-no-tab-ref
8889
id="{{_id}}-deleteSelectionElement"
8990
design="Transparent"
9091
icon="decline"

0 commit comments

Comments
 (0)