New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Slideovers): Allow multiple instances of programmatic slideover #1758
base: dev
Are you sure you want to change the base?
Conversation
Tagging @noook for feedback |
74aee7b
to
7253ac5
Compare
@noook Thanks for the comments, I made most changes. I'm thinking, would it make better sense to create instances without This would allow us do declare instances like this: const slideover = useSlideover()
const slideoverA = slideover.create(SlideoverExampleComponent)
const openSlideover = () => {
const slideoverA = slideover.open()
}
const doSomethingElse = () => {
slideOverA.patch({..})
}
const doAnotherThing = () => {
slideOverA.close()
} |
There is an issue: Slideovers should be dismissable when clicking outside unless you explicitly prevent them from closing with the appropriate prop. Your example components do not specify it so it should keep the original behaviour: |
The code changes in `Slideovers.client.vue` remove the unused `<pre>` element that displayed the `slideoverInstances` props. This cleanup improves code readability and removes unnecessary code.
I fixed it by listening to model changes on the modal and closing it when the model is changed. An issue I run into is that when clicking on the outside, it always closes the first one that was open, rather than the last one (i.e. the one on top). This issue would probably happen if we implement something similar in @noook Open to suggestions. |
π Linked issue
β Type of change
π Description
This PR opens the possibility to open multiple instance of the
<Slideover/>
component using theuseSlideover()
composable.This capability was discussed in the past, so this is an attempt at such a feature.
π Checklist