I have a modal dialog that contains a popup menu ("Add source" dialog in https://github.com/googlefonts/fontra/pull/2102, eg. the plust button below the glyph sources list). When using the popup menu, typing escape dismisses the dialog instead of the just the menu.
Possible cause:
- menu-panel uses a key event handler attached to the window, and dispatches a custom event
- the dialog has its own key even handler, which takes precedence over the menu-panel handler
If this is correct, the custom event dispatching mechanism of menu-panel is flawed: it cannot cooperate correctly in nested contexts such as these.
@giovanniTramonto, do you remember why you used a custom event in the first place?
https://github.com/googlefonts/fontra/blob/dd37f6752eb9da5854494b835b9d332d0e155813/src-js/fontra-webcomponents/src/menu-panel.js#L468-L472
I have a modal dialog that contains a popup menu ("Add source" dialog in https://github.com/googlefonts/fontra/pull/2102, eg. the plust button below the glyph sources list). When using the popup menu, typing escape dismisses the dialog instead of the just the menu.
Possible cause:
If this is correct, the custom event dispatching mechanism of menu-panel is flawed: it cannot cooperate correctly in nested contexts such as these.
@giovanniTramonto, do you remember why you used a custom event in the first place?
https://github.com/googlefonts/fontra/blob/dd37f6752eb9da5854494b835b9d332d0e155813/src-js/fontra-webcomponents/src/menu-panel.js#L468-L472