From 3e8fbf4c3ab7a4500b45c9758e6ff1df9cf73d98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Tue, 20 Jun 2023 13:49:32 +0300 Subject: [PATCH] Update TreeNode.vue --- components/lib/tree/TreeNode.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/components/lib/tree/TreeNode.vue b/components/lib/tree/TreeNode.vue index cd5b5611a..bc1689346 100755 --- a/components/lib/tree/TreeNode.vue +++ b/components/lib/tree/TreeNode.vue @@ -257,7 +257,9 @@ export default { this.setAllNodesTabIndexes(); }, setAllNodesTabIndexes() { - const nodes = DomHandler.find(this.$refs.currentNode.closest('[data-pc-section="container"]'), '[data-pc-section="treeitem"]'); + const nodes = DomHandler.find(this.$refs.currentNode.closest('[data-pc-section="container"]'), '[role="treeitem"]'); + + console.log(nodes); const hasSelectedNode = [...nodes].some((node) => node.getAttribute('aria-selected') === 'true' || node.getAttribute('aria-checked') === 'true'); @@ -277,7 +279,7 @@ export default { }, setTabIndexForSelectionMode(event, nodeTouched) { if (this.selectionMode !== null) { - const elements = [...DomHandler.find(this.$refs.currentNode.parentElement, '[data-pc-section="treeitem"]')]; + const elements = [...DomHandler.find(this.$refs.currentNode.parentElement, '[role="treeitem"]')]; event.currentTarget.tabIndex = nodeTouched === false ? -1 : 0; @@ -384,7 +386,7 @@ export default { getParentNodeElement(nodeElement) { const parentNodeElement = nodeElement.parentElement.parentElement; - return DomHandler.getAttribute(parentNodeElement, 'data-pc-section') === 'treeitem' ? parentNodeElement : null; + return DomHandler.getAttribute(parentNodeElement, 'role') === 'treeitem' ? parentNodeElement : null; }, focusNode(element) { element.focus(); @@ -393,7 +395,7 @@ export default { return this.selectionMode === 'checkbox'; }, isSameNode(event) { - return event.currentTarget && (event.currentTarget.isSameNode(event.target) || event.currentTarget.isSameNode(event.target.closest('[data-pc-section="treeitem"]'))); + return event.currentTarget && (event.currentTarget.isSameNode(event.target) || event.currentTarget.isSameNode(event.target.closest('[role="treeitem"]'))); } }, computed: {