fix(overflow): 🐛 allow to click through the nav element

This commit is contained in:
alistair3149 2024-06-12 12:51:50 -04:00
parent 7b5f6b455d
commit dd89daba39
No known key found for this signature in database
2 changed files with 12 additions and 11 deletions

View file

@ -146,17 +146,6 @@ class OverflowElement {
this.handleInheritedClasses();
fragment.appendChild( wrapper );
const content = document.createElement( 'div' );
content.className = 'citizen-overflow-content';
wrapper.appendChild( content );
const parentNode = this.element.parentNode;
parentNode.insertBefore( fragment, this.element );
content.appendChild( this.element );
this.wrapper = wrapper;
this.content = content;
if ( this.isPointerDevice ) {
const elementStyles = window.getComputedStyle( this.element );
const topMargin = parseInt( elementStyles.marginTop );
@ -180,6 +169,17 @@ class OverflowElement {
wrapper.appendChild( nav );
this.nav = nav;
}
const content = document.createElement( 'div' );
content.className = 'citizen-overflow-content';
wrapper.appendChild( content );
const parentNode = this.element.parentNode;
parentNode.insertBefore( fragment, this.element );
content.appendChild( this.element );
this.wrapper = wrapper;
this.content = content;
} catch ( error ) {
mw.log.error(
`[Citizen] Error occurred while wrapping element: ${ error.message }`

View file

@ -55,6 +55,7 @@
inset: 0;
display: flex;
justify-content: space-between;
pointer-events: none;
}
&-navButton {