-
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: Angular routerLink does not seem to take target in to account when using ion-item and ion-button #28881
Comments
IonItem with Anchor target _blank
if possible try to add the anchor tag |
IonItem with Anchor target _blank |
Could you show me what you mean? The |
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. |
In stackblitz I created a simple application with an anchor, ion-item and ion-button. You can find it here: https://stackblitz.com/edit/angular-rjzq6z-f5ejub?file=tsconfig.json |
Hello @j-oppenhuis, thanks for the reproduction! I have identified that this bug is a duplicate of #26394. Amanda previously mentioned it here: #26394 (comment), but with Ionic Framework focusing on mobile applications, we have not prioritized the behavior of opening content in a new tab within the context of a webview for our own components. I mentioned it in the PR to add support for the anchor tag, but if you are interested in submitting a fix for this issue, we will likely need to render an anchor around the element or within the shadow root to enable the functionality without excessive key listeners. I'm going to close this ticket in favor of the existing one. Feel free to upvote that issue if you would like to see it prioritized. Thanks! |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Prerequisites
Ionic Framework Version
v6.x, v7.x
Current Behavior
Currently when using an
ion-item
andion-button
element in combination withrouterLink
andtarget
, the target does not seem to be used.Expected Behavior
The working should be the same as when using an
anchor
element. When for exampletarget
is set to_blank
androuterLink
is set to/detail
a new tab should be opened in the browser.Steps to Reproduce
Code Reproduction URL
https://stackblitz.com/edit/angular-rjzq6z-f5ejub?file=tsconfig.json
Ionic Info
Ionic:
Ionic CLI : 7.1.1
Ionic Framework : @ionic/angular 7.2.3
@angular-devkit/build-angular : 16.2.0
@angular-devkit/schematics : 16.2.0
@angular/cli : 16.2.0
@ionic/angular-toolkit : 9.0.0
Capacitor:
Capacitor CLI : 5.1.1
@capacitor/android : 5.1.1
@capacitor/core : 5.1.1
@capacitor/ios : 5.1.1
Utility:
cordova-res : not installed globally
native-run : 1.7.2
System:
NodeJS : v16.19.0
npm : 8.19.3
OS : macOS Unknown
Additional Information
No response
The text was updated successfully, but these errors were encountered: