Skip to content

Commit 4cbb482

Browse files
authored
Fix JS error for "select" dropdown (#34743)
Regression of recent dropdown filter change.
1 parent 439ebe7 commit 4cbb482

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

web_src/js/modules/fomantic/dropdown.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ function updateSelectionLabel(label: HTMLElement) {
7272
}
7373

7474
function onAfterFiltered(this: any) {
75-
const $dropdown = $(this);
75+
const $dropdown = $(this).closest('.ui.dropdown'); // "this" can be the "ui dropdown" or "<select>"
7676
const hideEmptyDividers = $dropdown.dropdown('setting', 'hideDividers') === 'empty';
7777
const itemsMenu = $dropdown[0].querySelector('.scrolling.menu') || $dropdown[0].querySelector('.menu');
78-
if (hideEmptyDividers) hideScopedEmptyDividers(itemsMenu);
78+
if (hideEmptyDividers && itemsMenu) hideScopedEmptyDividers(itemsMenu);
7979
}
8080

8181
// delegate the dropdown's template functions and callback functions to add aria attributes.

0 commit comments

Comments
 (0)