File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 11class ModalWindow extends HTMLElement {
22 connectedCallback ( ) {
33 const dialog = this . querySelector ( 'dialog' ) ;
4+ if ( ! dialog ) {
5+ console . error ( 'No dialog element found' ) ;
6+ return ;
7+ }
8+
49 dialog . showModal ( ) ;
510
611 this . setupClose ( dialog ) ;
12+
13+ const selectbox = this . querySelector ( 'select-box' ) ;
14+ if ( selectbox ) {
15+ // If there is a selectbox child, allow for the dropdown
16+ // to overflow. This isn't a perfect solution either but works ok.
17+ // in larger modals that have scroll, elements can overflow with this change.
18+ selectbox . addEventListener ( 'open' , function ( ) {
19+ dialog . style . overflow = 'visible' ;
20+ } ) ;
21+ selectbox . addEventListener ( 'close' , function ( ) {
22+ dialog . style . overflow = 'auto' ;
23+ } ) ;
24+ }
725 }
826
927 setupClose ( dialog : HTMLDialogElement | null ) : void {
You can’t perform that action at this time.
0 commit comments