Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions coral-base-list/src/scripts/BaseList.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ const BaseList = (superClass) => class extends superClass {
setIndex(element, value) {
if (element instanceof HTMLElement) {
element.setAttribute("tabindex", value);
const el = element.querySelectorAll("button:not([hidden])");
const buttonArray = Array.from(el).filter(item => item.offsetParent);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we use “offsetParent === null” as “treat as hidden / skip.”? are we sure that if offsetParent is null, does it means hidden?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's basically the same logic as the one on line 205 (this.items._getSelectableItems().filter(item => !item.hasAttribute('hidden') && item.offsetParent);)
filter(el => el.offsetParent) = elements that are display:none, or in our case, which are hidden

buttonArray.forEach(item => {
item.setAttribute("tabindex", value);
});
}
}

Expand Down
Loading