You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If one wants to force certain link href urls to be compulsorily fetched from server, rather than being handled at client side by router, there is no way to do so. Unless you modify and provide your own custom click handler with additional logic.
However, supporting this feature requires a really simple change in the triggers\click.js file.
// ignore the click if the <a> element has the 'download' or 'router-ignore' attributeif(anchor.hasAttribute('download')||anchor.hasAttribute('vaadin-ignore')){return;}
The click.js logic already checks and ignores handling click when the link has "download" attribute. The same can be applied for a custom attribute say "vaadin-ignore". If the link has that attribute than avoid handling the click and let browser continue with server fetch.
I recall some routing frameworks monitor target="_self" for this purpose. However, in your code you have specifically decided to ignore targets other than "_self". Hence, suggesting the custom attribute option. Otherwise, as an alternative, you can also consider full server fetch for target="_self".
The text was updated successfully, but these errors were encountered:
Good news! This feature has been just recently added to Vaadin Router. It's available since the 1.6.0 release.
However, I've noticed that the docs have not been updated on time, and thus it was not properly documented. Now that is also fixed and the docs have been updated. You can find it by searching for excluded links on the Getting Started page.
If one wants to force certain link href urls to be compulsorily fetched from server, rather than being handled at client side by router, there is no way to do so. Unless you modify and provide your own custom click handler with additional logic.
However, supporting this feature requires a really simple change in the triggers\click.js file.
The click.js logic already checks and ignores handling click when the link has "download" attribute. The same can be applied for a custom attribute say "vaadin-ignore". If the link has that attribute than avoid handling the click and let browser continue with server fetch.
I recall some routing frameworks monitor target="_self" for this purpose. However, in your code you have specifically decided to ignore targets other than "_self". Hence, suggesting the custom attribute option. Otherwise, as an alternative, you can also consider full server fetch for target="_self".
The text was updated successfully, but these errors were encountered: