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
As a developer, I often need to switch between modals, such as when I have Sign In modal with a button to open Sign Up modal and vice versa. However, oruga.modal.open() always opens the new modal on top of the old modal.
I propose to add a new flag/option to OrugaOptions: modal: { closeAll?: boolean }, available as global config option, component option, and programmatic open option.
Why Oruga need this feature
This will reduce boilerplate/simplify modals flow for many projects. Arguably, closeAll more often than not will be enabled by default by the developers and only explicitly disabled in few cases when the UX flow involves nested modals.
The text was updated successfully, but these errors were encountered:
Similarly, there could be closeActive option (perhaps only for oruga.modal.open() and not for the declarative setup) that will allow to close the topmost modal but keep the upper layered modals. The example use case will be:
There is Auth Modal which presents two buttons: Sign In and Sign Up, both opening the respective nested modal.
Sign In modal allows to switch to Sign Up modal and vice versa. closeAll will not work here because the upper Auth Modal should stay, only the nested modals should replace each other.
I suppose that is currently possible by emitting close before opening the new modal, but that requires a lot of boilerplate in each component. It can't be decomposed into a composable similarly to the above. Thus, the new option will be very helpful.
Hey @IlyaSemenov, with #1058 I reimplemented the programmatic interfaces of the relevant components.
I don't see the purpose of adding closeAll property to the open() interface. I think those things are to specialist application behaviors and can also just called before open a new one.
But I added a close() interface that closes the last open programmatic component in the instance registry stack.
Description
As a developer, I often need to switch between modals, such as when I have Sign In modal with a button to open Sign Up modal and vice versa. However,
oruga.modal.open()
always opens the new modal on top of the old modal.I end up using this composable:
and then:
I propose to add a new flag/option to
OrugaOptions
:modal: { closeAll?: boolean }
, available as global config option, component option, and programmatic open option.Why Oruga need this feature
This will reduce boilerplate/simplify modals flow for many projects. Arguably,
closeAll
more often than not will be enabled by default by the developers and only explicitly disabled in few cases when the UX flow involves nested modals.The text was updated successfully, but these errors were encountered: