seed-rs / seed

A Rust framework for creating web apps
MIT License
3.8k stars 153 forks source link

Seed shouldn't intercept links with `target` attribute #497

Open MartinKavik opened 4 years ago

MartinKavik commented 4 years ago

See https://github.com/seed-rs/seed/blob/38f6c201206b9988abf60d9c399383e3734a6414/src/browser/service/routing.rs#L101

Should we ignore all links with set target or only with some target values (e.g. _self)?

MDN docs: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a


Workaround:

orders.subscribe(|subs::UrlRequested(url, url_request)| {
    if should_not_intercept_this_url(url) {
        url_request.handled()
   }
});
arn-the-long-beard commented 3 years ago

Hey, why should we ignore it ?

Here is the quote from the doc :

target Where to display the linked URL, as the name for a browsing context (a tab, window, or