-
Notifications
You must be signed in to change notification settings - Fork 4
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
It's necessary for the next button to be inside ? #9
Comments
As-is, generally yeah, because the way the step controller functions is by dispatching events, which get consumed by the stepper. So the events need to originate from step components which are nested below the stepper. However, there's probably a way to work around this. Without having thought about this a lot, I would try something like catching the step controller's events (you can find them here), and exporting a function from your step components that just re-emits any event you pass it, and then using this function to re-emit events within the scope of the stepper. Another approach could be to use a svelte portal to "portal" the next / previous buttons from within the step components to elsewhere into the DOM. |
Closing for now, lmk if you run into any trouble with the suggestions 👍 |
I think this could be a pretty nice feature |
Can you please provide me an example? I'm kinda new to Svelte |
Re-opening this since I'm thinking exporting a @lucabrini I think the easiest approach for now would be to use a "portal", like this one: https://github.com/romkor/svelte-portal The steps would simply be:
Disclaimer: I haven't tried it yet, but I can't see why it wouldn't work. |
Cool!
Thank you so much, didn't know about portals :) |
When I try to place the next button outside the stepper, it doesn't work for me. The UI I have requires the next button to be positioned outside the steps.
The text was updated successfully, but these errors were encountered: