You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[DREAM-704] Tree view selection based on path identity breaks use cases where similar paths are allowed (#475)
* Keep the node object after selection instead of fetching it by the path
* Fix single-select toggle-off and form payload disambiguation
- Fix treeViewNodeChecked/Before events reporting wrong checkedValue on toggle-off (was hardcoded 'true', now reflects actual new state)
- Align keyboard Space/Enter with click: pressing Space on an already-selected single-select node now deselects it
- Include data-node-id as nodeId in hidden form input payload so duplicate-path nodes are distinguishable on the server side
* Adapt test to avoid being trapped in the focus zone
* Pass nodeId in filterableTreeView as well
* Generating component snapshots
* Generating component snapshots
---------
Co-authored-by: HDinger <7457313+HDinger@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Fix selection of nodes with the same path in Primer::Alpha::TreeView
6
+
7
+
When a `[role=treeitem]` element carries a `data-node-id` attribute, that id is now included as `nodeId` in the hidden form input payload (`{path, nodeId?, value?}`). Trees with duplicate-path nodes should set `data-node-id` to a stable unique identifier so the server can distinguish which node was selected.
8
+
9
+
**Breaking change in `TreeViewElement#checkOnlyAtPath`:** if the given path is not found the method is now a no-op. Previously it would uncheck all active nodes before failing to check the missing node, which could be used as an indirect "clear selection" mechanism. Use explicit `setNodeCheckedValue(node, 'false')` calls if that behaviour is needed.
0 commit comments