sl-dialog
grabs focus
from 3rd party element
#870
Replies: 1 comment 3 replies
-
When a modal-capable component such as While Shoelace's modal utility allows for nested modals by keeping track of which ones are active, it only works for Shoelace modals that use the utility. That means third-party dialogs will be fighting with Shoelace dialogs for focus. If you can place the MoxieManager dialog inside your Shoelace dialog, that might work. It's not the cleanest solution, but without a modal utility that all dialogs/drawers/etc. can tap into, I'm not sure of another way to work around it. One option is to allow users to disable the dialog's modal behavior (see #841), but I can't think of a solid use case for contained dialogs outside of making things like this work, and that will lead to problems with accessibility. |
Beta Was this translation helpful? Give feedback.
-
Hi there,
we are triggering a MoxieManager window to manage folders and images for some content.
This layer is opened from a button within the
sl-dialog
.Now it happen, that the
sl-dialog
from where the MoxieManager is opened, grabs the focus. If we type one charachter (keydown
), the focus from filter field is lost. We must click again in this field to type the next character.Is there a possibility to prevent this behavior? Or is this this a problem caused by bad design on my side? 😆
debugger;
onfocusin
event onsl-dialog
- see it doescheckFocus
Using Shoelace beta.79
Purely from the context, maybe the check of the dialog
this.isActive()
should returnfalse
, if none of its elements are focused?Beta Was this translation helpful? Give feedback.
All reactions