File tree 1 file changed +5
-2
lines changed
web_src/js/modules/fomantic
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -21,14 +21,17 @@ export function initAriaDropdownPatch() {
21
21
function ariaDropdownFn ( this : any , ...args : Parameters < FomanticInitFunction > ) {
22
22
const ret = fomanticDropdownFn . apply ( this , args ) ;
23
23
24
- for ( const el of this ) {
24
+ for ( let el of this ) {
25
+ // dropdown will replace '<select class="ui dropdown"/>' to '<div class="ui dropdown"><select (hidden)></select><div class="menu">...</div></div>'
26
+ // so we need to correctly find the closest '.ui.dropdown' element, it is the real fomantic dropdown module.
27
+ el = el . closest ( '.ui.dropdown' ) ;
25
28
if ( ! el [ ariaPatchKey ] ) {
26
29
// the elements don't belong to the dropdown "module" and won't be reset
27
30
// so we only need to initialize them once.
28
31
attachInitElements ( el ) ;
29
32
}
30
33
31
- // if the `$().dropdown()` call is without arguments, or it has non-string (object) argument,
34
+ // if the `$().dropdown()` is called without arguments, or it has non-string (object) argument,
32
35
// it means that such call will reset the dropdown "module" including internal settings,
33
36
// then we need to re-delegate the callbacks.
34
37
const $dropdown = $ ( el ) ;
You can’t perform that action at this time.
0 commit comments