However, it's currently left to the user to "find" a specific node that they want to expand. The existing accessor also only applied to "expandable" nodes (i.e., nodes with children).
This PR addresses the use case of making an explicit node visible by adding a new accessor showNode. It accepts a node ID, and, if found, will expand, select, and focus the node.
Closes #1377
TreeView
already exposes anexpandNodes
accessor.However, it's currently left to the user to "find" a specific node that they want to expand. The existing accessor also only applied to "expandable" nodes (i.e., nodes with children).
This PR addresses the use case of making an explicit node visible by adding a new accessor
showNode
. It accepts a node ID, and, if found, will expand, select, and focus the node.Demo
https://github.com/carbon-design-system/carbon-components-svelte/assets/10718366/034e88ab-baed-4319-b1c8-ea1629244dd3