From 2648933ddbe4626c9ed9a1ad53e54d3147626f10 Mon Sep 17 00:00:00 2001 From: kyybo <106741733+kyybo@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:26:52 +0200 Subject: [PATCH] Fix #7166 - Datatable : fix ColumnFilter aria-controls (#7167) Set 'aria-controls' for ColumnFilter only when the menu filter is visible. fix #7166 --- components/lib/datatable/ColumnFilter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/lib/datatable/ColumnFilter.js b/components/lib/datatable/ColumnFilter.js index 4b86a99fcb..ab0c22cf85 100644 --- a/components/lib/datatable/ColumnFilter.js +++ b/components/lib/datatable/ColumnFilter.js @@ -559,7 +559,7 @@ export const ColumnFilter = React.memo((props) => { 'aria-haspopup': true, 'aria-expanded': overlayVisibleState, 'aria-label': label, - 'aria-controls': overlayId.current, + 'aria-controls': overlayVisibleState ? overlayId.current : undefined, onClick: (e) => toggleMenu(e), onKeyDown: (e) => onToggleButtonKeyDown(e) },