From 8c6d4d56d7c94766d2ad3fb218563f21fe65aa5a 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: Thu, 10 Aug 2023 16:39:14 +0300 Subject: [PATCH] Fixed #3702 - DataTable and TreeTable: Column sorting not working correctly when using custom header template --- components/lib/datatable/DataTable.vue | 3 ++- components/lib/treetable/TreeTable.vue | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/lib/datatable/DataTable.vue b/components/lib/datatable/DataTable.vue index 054278bdc..a60a72d31 100755 --- a/components/lib/datatable/DataTable.vue +++ b/components/lib/datatable/DataTable.vue @@ -466,7 +466,8 @@ export default { DomHandler.getAttribute(targetNode, 'data-pc-section') === 'headercontent' || DomHandler.getAttribute(targetNode, 'data-pc-section') === 'sorticon' || DomHandler.getAttribute(targetNode.parentElement, 'data-pc-section') === 'sorticon' || - DomHandler.getAttribute(targetNode.parentElement.parentElement, 'data-pc-section') === 'sorticon' + DomHandler.getAttribute(targetNode.parentElement.parentElement, 'data-pc-section') === 'sorticon' || + targetNode.closest('[data-p-sortable-column="true"]') ) { DomHandler.clearSelection(); diff --git a/components/lib/treetable/TreeTable.vue b/components/lib/treetable/TreeTable.vue index 03182622c..81d199578 100755 --- a/components/lib/treetable/TreeTable.vue +++ b/components/lib/treetable/TreeTable.vue @@ -364,7 +364,8 @@ export default { DomHandler.getAttribute(targetNode, 'data-pc-section') === 'headertitle' || DomHandler.getAttribute(targetNode, 'data-pc-section') === 'sorticon' || DomHandler.getAttribute(targetNode.parentElement, 'data-pc-section') === 'sorticon' || - DomHandler.getAttribute(targetNode.parentElement.parentElement, 'data-pc-section') === 'sorticon' + DomHandler.getAttribute(targetNode.parentElement.parentElement, 'data-pc-section') === 'sorticon' || + targetNode.closest('[data-p-sortable-column="true"]') ) { DomHandler.clearSelection();