You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RouterLink is not working inside modal dialog #13270
Keep in mind that this is just a simple example; a more complex example is a RouterLink rendered with a LItRenderer inside a Grid which is inside the modal dialog where no direct parent/child relationship between the dialog and the RouterLink is available on the server side.
Seems RouterLink navigation is explicitly denied if UI is inert (in v14 bootstrap mode)
// When the UI is made inert, all router link navigation is
// ignored. For the part of the UI that is not inert, navigation
// could be allowed by using something else than router links (with
// server side listeners).
// Blocking browser history back / forward navigation is not done
// as it would be dubious and even impossible on the client side.
This ofc shouldn't be the case when the navigation is from inside the modal component. For js bootstrap it is blocked in the connect client due to inert state navigation is blocked which is problematic as the UI is always inert if a modal component is set.
As pointed out above, it won't be easy to cover all uses of RouterLink inside a modal component. In fact, even the seemingly simple case has no obvious solution currently.
Navigation has been disabled intentionally with the idea that typically one has little reason to navigate when in a modal component.
We are curious about your use case @knoobie. Why do you need RouterLinks inside a modal, and why working around them by using something else than router links (with server side listeners) is not an option?
Simply accessibility - links (RouterLink) are the way to go for an inclusive webdesign. I currently have a workaround in place for the specific dialog (making it non-modal) but that was an undocumented behaviour change that should be at least be documented as limitation or mentioned somewhere (that is not a comment inside java code of flow)
Tbh I was kinda confused that a dialog is by default modal and you have to opt-out from it; that's how I stumbled upon it because I explicitly called setModal(true) on other dialogs but not on this one.
(I know there is a sentence about it in the docs; still not expected default coming from other business application where you have multiple dialogs side by side opening and dragging them around)
Activity
knoobie commentedon Mar 10, 2022
Keep in mind that this is just a simple example; a more complex example is a RouterLink rendered with a LItRenderer inside a Grid which is inside the modal dialog where no direct parent/child relationship between the dialog and the RouterLink is available on the server side.
caalador commentedon Mar 11, 2022
Seems RouterLink navigation is explicitly denied if UI is inert (in v14 bootstrap mode)
This ofc shouldn't be the case when the navigation is from inside the modal component. For js bootstrap it is blocked in the connect client due to
inert state navigation is blockedwhich is problematic as the UI is always inert if a modal component is set.anssit commentedon Mar 16, 2022
As pointed out above, it won't be easy to cover all uses of RouterLink inside a modal component. In fact, even the seemingly simple case has no obvious solution currently.
Navigation has been disabled intentionally with the idea that typically one has little reason to navigate when in a modal component.
We are curious about your use case @knoobie. Why do you need
RouterLinks inside a modal, and why working around themby using something else than router links (with server side listeners)is not an option?knoobie commentedon Mar 16, 2022
Simply accessibility - links (RouterLink) are the way to go for an inclusive webdesign. I currently have a workaround in place for the specific dialog (making it non-modal) but that was an undocumented behaviour change that should be at least be documented as limitation or mentioned somewhere (that is not a comment inside java code of flow)
caalador commentedon Mar 17, 2022
I guess it should be documented as a limitation on each of the modal components documentation.
Also I couldn't find documentation on the sever-side modality at all so that should be added to the advanced section.
knoobie commentedon Mar 17, 2022
Tbh I was kinda confused that a dialog is by default modal and you have to opt-out from it; that's how I stumbled upon it because I explicitly called setModal(true) on other dialogs but not on this one.
(I know there is a sentence about it in the docs; still not expected default coming from other business application where you have multiple dialogs side by side opening and dragging them around)
feat: Allow navigation with RouterLinks when inert (#13331)
feat: Allow navigation with RouterLinks when inert (#13331)
feat: Allow navigation with RouterLinks when inert (#13331) (#13334)
vaadin-bot commentedon Mar 28, 2022
This ticket/PR has been released with Vaadin 23.0.3.