-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
bug: ion-item href prop causes hard refresh when clicked, and routerLink prop disallows ctrl+click to open in new tab #26394
Comments
Thanks for the request. Could you post a reproduction of the issues you're running into? |
Thanks for the issue! This issue has been labeled as Please reproduce this issue in an Ionic starter application and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed. If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue. For a guide on how to create a good reproduction, see our Contributing Guide. |
Here you go, using the simple "list" default app: https://github.com/maelp/ionic-href-issue
|
Thank you, and apologies for the delay. I've confirmed that this behavior exists in all three frameworks (Angular/React/Vue) when using While shift+click is a desktop behavior and we're trying to move our focus to mobile apps exclusively, we've addressed this with regular anchor links in Angular before: #25014 The There are three possible things that may need doing here:
|
ion-item
href
prop causes hard refresh when clicked, and routerLink
prop disallows ctrl+click to open in new tab
ion-item
href
prop causes hard refresh when clicked, and routerLink
prop disallows ctrl+click to open in new tab
Thanks, any news on this? :) |
I am also encountering this but, and using
Is there anything I can do to help move this along? Have you decided the desired functionality? It seems the |
Is there any news on this item? :) |
This seems to be an accessibility issue as well. With IonItem and the href attribute specified I can tab to the item and navigate with my keyboard. Middle-click, right-click, or shift-click also work fine on the web. IonItem is correctly detected as a link by the browser. However, there's a full page reload after navigation and everything flashes black for a second. It's not great to need to remember specify both router-link and href with the exact same values every time you want to make a link, but it's workable. With IonRouterLInk I can't use keyboard navigation at all. IonRouterLinks are not in the tab order, there's no middle, right, or shift-click, and the item isn't detected as a link by the browser at all. |
Prerequisites
Describe the Feature Request
For now, if we use "router-link" args on ion-button or other tags in the app, this does not allow to do a "shift+click" to open a link in a new tab. For this, we need to use "href" args.
But using "href" args seems to break the "swipe-to-navigage-back" behavior on iOS.
Is it possible to reconcile both? Either have the swipe-to-navigate-back gesture work even when following href links, or have a way to selectively choose the "href-behavior" when compiling for the web, and the "router-link" behavior when compiling on mobile?
Describe the Use Case
This would allow people to have the best of both worlds: allow to open views in new tabs when needed on web UIs, and allow to have the "swipe-to-go-back" gesture on iOS
Describe Preferred Solution
No response
Describe Alternatives
No response
Related Code
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: