Skip to content
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

Feature Requests #4

Open
ogrotten opened this issue Aug 17, 2023 · 2 comments
Open

Feature Requests #4

ogrotten opened this issue Aug 17, 2023 · 2 comments

Comments

@ogrotten
Copy link

ogrotten commented Aug 17, 2023

I have a couple of suggestions/ideas. I'm going to try to dig into it soon and see what I can find and maybe do a PR.

stepName prop

	makeStep({
		component: Page6,
		props: undefined,
		stepName: "Location"
	}),

and then do like

	on:stepChange={e => {
		const { newIndex, of, direction, stepName } = e.detail
	}}

This would offer some flexibility in finding steps for conditionals. If I move Page6 to Page8, I wouldn't have to change if (e.detail.stepName === "Location")

Nice To Have

As a "nice to have", if the component emitted on:next and on:prev events. It could be argued that you can already do those functions by looking at forward vs backward etc. The suggestion tho would just take some of the tedium off of it.

Using dispatch

Also, if I dispatch from say the Page6 component, it doesn't get passed up to be caught on the <Stepper /> call. Right now, if I do a thing in there that I'd normally dispatch, unless I've missed something I would instead have to use a separate store or context to go around the component level and pass events up. That could be hairy to detect and pass as the same name. I don't know how it'd be done. An attribute like on:custom (with your dispatches in the detail) would be a simple workaround, but it kinda gets outside of being Svelte-Like.

api section

Docs could use this to explicitly state what the available functions are.

@efstajas
Copy link
Owner

Hey! Apologies for the late response, been out & about lately so didn't have a lot of time. These suggestions make a lot of sense — can't make any promises as to when exactly, but will definitely try to get some of them done sometime soon. Of course, if anyone else sees this and wants to take a stab at anything, feel free 🖖

Thanks a lot for the great ideas!

@brendan-morin
Copy link

brendan-morin commented Oct 1, 2024

Just chiming in here - I'm also running into questions for how to handle when I want to bubble up a dispatched even from a step and handle it at the Stepper level.

I was originally thinking this would be a nice mechanism to handle side steps - that way I can have components that are independent of the stepper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants