-
Notifications
You must be signed in to change notification settings - Fork 156
Seed app taking over some navigation on page #473
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
Comments
|
I am on the latest version of seed now, and through logging I've narrowed the problem down to these lines: seed/src/browser/service/routing.rs Lines 173 to 179 in 3134d21
I haven't been able to follow exactly what is happening yet (I'm going to keep working on it later), but at some point in that code, |
I've also determined that on the links that are working, for some reason the event target is an unrelated |
I think I understand your problem now.
It's not bug, it's feature. Seed intercepts all links and in some cases (e.g. fn init(url: Url, orders: &mut impl Orders<Msg>) -> Model {
orders
.subscribe(|subs::UrlRequested(_, url_request)| url_request.handled()) Docs - UrlRequest methods I can describe you how link handling works, however it'll be written in official seed-rs.org docs in a few weeks. Please make sure you test on the current Seed master so we can debug the same code.
If your |
That code snippet has solved the problem. Perhaps it will make more sense once this is all fully documented, but it seems odd to me that seed would seed/src/browser/service/routing.rs Lines 181 to 188 in 3134d21
Again, I may just be missing some context here that would help this make sense. I may have a bit more insight into what's happening with the
and after a link gets clicked on, some other JS lib is changing the menu item into this:
The link is still in the DOM, but perhaps being set to |
That code is a deprecated part of the old API - the important code is now: seed/src/browser/service/routing.rs Lines 173 to 179 in 3134d21
Then there is Seed's internal subs::UrlRequested subscriber, that is invoked after user's subscribers (e.g. your snippet to disable Seed's default link handling) and if the user hasn't changed UrlRequest status to handled , then Seed's internal subscriber prevents default browser behavior, pushes url to the browser history and fires subs::UrlChanged .
I don't know what do you mean by "doesn't have route handling logic for" - there is basically no router in Seed => you just listen for
In general, front-end frameworks don't like modifying DOM by other libraries because it often breaks VDOM patching - it's possible that your library accidentally forces Seed to patch/recreate links or it removes link interceptors. The safest integration of JS libs is to leverage Web Components (custom elements). I hope it makes sense a bit, I'll try to write it better in the docs. |
Thanks, that clears things up a bit. I got hung up on that deprecated code. What I meant by "doesn't have route handling logic for" is just if the |
I may not be using the seed API correctly, but I am experiencing a bug while including a seed app in an existing page. When clicking most of the links on the existing page, the address in my browser's address bar is updated, but the new URL isn't actually navigated to. Curiously, a few links on the page still work, and I haven't been able to discern what sets them apart. My app does not handle any routing, and I have built the app with this code:
I'm on seed v0.6 if that makes any difference. I'm hoping I'm just missing something in the docs, but at this point I'm stumped.
The text was updated successfully, but these errors were encountered: