File tree Expand file tree Collapse file tree
Resources/Public/JavaScript Expand file tree Collapse file tree Original file line number Diff line number Diff line change 339339 const menuBtn = this . container . querySelector ( '.frontend-edit__sticky-btn--menu' ) ;
340340 const dropdown = this . container . querySelector ( '.frontend-edit__sticky-dropdown' ) ;
341341
342+ // Move dropdown to document.body so position:fixed works correctly
343+ // (toolbar may have CSS transform which creates a new containing block)
344+ document . body . appendChild ( dropdown ) ;
345+
342346 menuBtn . addEventListener ( 'click' , async ( e ) => {
343347 e . stopPropagation ( ) ;
344348 const isVisible = dropdown . classList . contains ( 'frontend-edit__sticky-dropdown--visible' ) ;
351355 } ) ;
352356
353357 document . addEventListener ( 'click' , ( e ) => {
354- if ( ! dropdownContainer . contains ( e . target ) ) {
358+ if ( ! dropdownContainer . contains ( e . target ) && ! dropdown . contains ( e . target ) ) {
355359 dropdown . classList . remove ( 'frontend-edit__sticky-dropdown--visible' ) ;
356360 }
357361 } ) ;
You can’t perform that action at this time.
0 commit comments