-
-
Notifications
You must be signed in to change notification settings - Fork 332
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
Stepper update to drop length/index props #222
Comments
Trying to take care of this :) |
Assigned! |
See also: #332 |
@Sarenor So I spent some time testing this today. Unfortunately, as cool as the "self register" method is per the REPLs above, this method is just too slow for a real world use case. Even stripped down to the basics, there's visually noticeable delay while the setup process occurs. Plus, in additional to the visual delay, you also get issues with the HMR of Vite where the child indexes start duplicating. This requires a hard refresh on the page to correct. Here's what that looks like. Note I have 3 children, but 6 items registered in the Given this, I think our current implementation is going to be the best we can do for the moment. At least until another technique for handling this is found. To be honest, it's annoying having to supply values manually, but it's not the end of the world. If people want to use this component, they will. I think with this I'm going to close out this issue and the PR. Though they'll remain archived if we need to refer to them in the future. Thanks for your help on testing this one and sorry this hasn't worked out. Sometimes that's how it goes! |
We had a great suggestion on the Svelte support section that explained how we can build the child count (length prop) and child index values (index props) into the components to be automatically generated and maintained.
Here's a basic proof of concept:
https://svelte.dev/repl/e2ca4f024dfa482f9715edab4f67b677?version=3.50.1
Here's a more advanced version that allows for children to be added/removed dynamically:
https://svelte.dev/repl/d5d784109e2145dd8f41906e16bfb89a?version=3.50.1
Unfortunately these seem subject to the same Vite HMR (hot module reload) issue that our Code Block is. When code is modified in the Step component the index values get multiplied. However, if we can work around this, it would make the Stepper MUCH easier for end users to implement.
The text was updated successfully, but these errors were encountered: