-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: add qnavigatestart and qnavigateend events #2202 #2203
Conversation
Signed-off-by: Jeremy Wickersheimer <jwickers@gmail.com>
Run & review this pull request in StackBlitz Codeflow. |
While i like the idea, this needs a bit of design work before get merged! this would be the first event based API to it sets a precedence, also it global, dispatched in the document, which is not ideal... I agree this is a problem to solve though |
Yes, normally I'd also prefer using a store, like the context used by useNavigate for example, and this is what sveltekit does for example https://kit.svelte.dev/docs/modules#$app-stores-navigating But I couldn't make that work in qwik because I think of the DOM update buffering causing the DOM not to react in real time in that case until the navigation is finished. Right now using global events seems to be the best way to implement this. |
Also I think that using the events we could also make the navigationstart cancellable, so similar to the beforeunload event one could listen to that and on some pages ask user for confirmation before leaving and call prevent default. I don't think this is as easily doable with a store? |
Hi @jwickers 👋 @manucorporat : do you have smth on the radar/roadmap for this or a rough idea of how this could be implemented? also happy to give a hand for this feature ✋ 😄 |
@jwickers is this PR closed by #3244? cc @billykwok |
I'm not using this PR as we did something else that works well enough using the current APIs, so yeah I'll close it. |
Thanks 👍 |
Signed-off-by: Jeremy Wickersheimer jwickers@gmail.com
What is it?
Description
Implement the events for issue #2202
Use cases and why
Checklist: