File tree Expand file tree Collapse file tree
ts/WoltLabSuite/Core/Component
wcfsetup/install/files/js/WoltLabSuite/Core/Component Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,13 +74,17 @@ export class GridView {
7474
7575 #initInteractions( ) : void {
7676 wheneverFirstSeen ( `#${ this . #table. id } tbody tr` , ( row ) => {
77+ const containers = [ row ] ;
78+
7779 row . querySelectorAll < HTMLElement > ( ".dropdownToggle" ) . forEach ( ( element ) => {
78- let dropdown = UiDropdownSimple . getDropdownMenu ( element . dataset . target ! ) ;
79- if ( ! dropdown ) {
80- dropdown = element . closest ( ". dropdown" ) ! . querySelector < HTMLElement > ( ".dropdownMenu" ) ! ;
80+ const dropdown = UiDropdownSimple . getDropdownMenu ( element . dataset . target ! ) ;
81+ if ( dropdown ) {
82+ containers . push ( dropdown ) ;
8183 }
84+ } ) ;
8285
83- dropdown ?. querySelectorAll < HTMLButtonElement > ( "[data-interaction]" ) . forEach ( ( element ) => {
86+ for ( const container of containers ) {
87+ container . querySelectorAll < HTMLButtonElement > ( "[data-interaction]" ) . forEach ( ( element ) => {
8488 element . addEventListener ( "click" , ( ) => {
8589 row . dispatchEvent (
8690 new CustomEvent ( "interaction:execute" , {
@@ -90,7 +94,7 @@ export class GridView {
9094 ) ;
9195 } ) ;
9296 } ) ;
93- } ) ;
97+ }
9498 } ) ;
9599 }
96100
You can’t perform that action at this time.
0 commit comments