Skip to content

fix(openscd): close the modal menu before opening another modal - #174

Merged
clepski merged 1 commit into
com-pas:mainfrom
ase-compas:fix/dialog-clicks-behind-drawer-scrim
Oct 8, 2026
Merged

clepski merged 1 commit into
com-pas:mainfrom
ase-compas:fix/dialog-clicks-behind-drawer-scrim

Conversation

@brabenetz

@brabenetz brabenetz commented Sep 18, 2026 •

Copy link
Copy Markdown

The side menu is a modal mwc-drawer. Choosing a menu item often opens a second modal (mwc-dialog: Settings, Plugins, Open, Save, …). Both overlays stay in the stack: In general this works, but under special circumstances — when a dialog opens on top while the drawer is still open — the drawer scrim can keep capturing clicks and the dialog can look frozen (only Escape still works).

This applies to every menu item that opens a dialog. It showed up while consuming this package from CoMPAS (com-pas/compas-open-scd) via a local link; two stacked modals are enough to trigger it.

Changes

  • Layout.ts: close the drawer on every menu list action (menuUI.open = false) so only one modal is open. Ctrl+P goes through the Plugins menu item so it uses the same path.

How to try

Open the menu and pick any item that shows a dialog (Settings, Plugins, Open, …). Dialog buttons and inputs should be clickable. Escape still dismisses the dialog.

image

@brabenetz

Copy link
Copy Markdown
Author

Basically only one line changed:
image

@Sander3003

Copy link
Copy Markdown
Member

Sounds good to me to fix.

@Sander3003

Copy link
Copy Markdown
Member

@noraeb @EFMH also agree with your proposal to close the menu automatically

The modal mwc-drawer scrim stayed open and swallowed pointer events,
so Settings and Plugins dialogs looked frozen (Escape still worked).
@brabenetz
brabenetz force-pushed the fix/dialog-clicks-behind-drawer-scrim branch from 42b1dc6 to aa48454 Compare September 24, 2026 08:37
@brabenetz
brabenetz marked this pull request as ready for review September 29, 2026 10:38
Comment thread packages/openscd/src/addons/Layout.ts
@clepski
clepski merged commit 90665ff into com-pas:main Oct 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

5 participants