Fix JS error for "select" dropdown (#34743) (#34749)

Backport #34743 by wxiaoguang

Regression of recent dropdown filter change.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
pull/34748/head^2
Giteabot 2025-06-17 22:34:14 +07:00 committed by GitHub
parent 8ab1363fef
commit a43d829de8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

@ -72,10 +72,10 @@ function updateSelectionLabel(label: HTMLElement) {
}
function onAfterFiltered(this: any) {
const $dropdown = $(this);
const $dropdown = $(this).closest('.ui.dropdown'); // "this" can be the "ui dropdown" or "<select>"
const hideEmptyDividers = $dropdown.dropdown('setting', 'hideDividers') === 'empty';
const itemsMenu = $dropdown[0].querySelector('.scrolling.menu') || $dropdown[0].querySelector('.menu');
if (hideEmptyDividers) hideScopedEmptyDividers(itemsMenu);
if (hideEmptyDividers && itemsMenu) hideScopedEmptyDividers(itemsMenu);
}
// delegate the dropdown's template functions and callback functions to add aria attributes.