File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
web_src/js/modules/fomantic Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -21,14 +21,17 @@ export function initAriaDropdownPatch() {
2121function ariaDropdownFn ( this : any , ...args : Parameters < FomanticInitFunction > ) {
2222 const ret = fomanticDropdownFn . apply ( this , args ) ;
2323
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' ) ;
2528 if ( ! el [ ariaPatchKey ] ) {
2629 // the elements don't belong to the dropdown "module" and won't be reset
2730 // so we only need to initialize them once.
2831 attachInitElements ( el ) ;
2932 }
3033
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,
3235 // it means that such call will reset the dropdown "module" including internal settings,
3336 // then we need to re-delegate the callbacks.
3437 const $dropdown = $ ( el ) ;
You can’t perform that action at this time.
0 commit comments