mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 11:36:36 +00:00
fix(tree-view): make first focusable node tabbable regardless of active/selected states
This commit is contained in:
parent
9e5adfa986
commit
48d4c0ba37
1 changed files with 5 additions and 7 deletions
|
@ -81,7 +81,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
if ($activeNodeId !== $selectedNodeIds[0]) {
|
|
||||||
const firstFocusableNode = ref.querySelector(
|
const firstFocusableNode = ref.querySelector(
|
||||||
"li.bx--tree-node:not(.bx--tree-node--disabled)"
|
"li.bx--tree-node:not(.bx--tree-node--disabled)"
|
||||||
);
|
);
|
||||||
|
@ -89,7 +88,6 @@
|
||||||
if (firstFocusableNode != null) {
|
if (firstFocusableNode != null) {
|
||||||
firstFocusableNode.tabIndex = "0";
|
firstFocusableNode.tabIndex = "0";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$: activeNodeId.set(activeId);
|
$: activeNodeId.set(activeId);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue