question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[4.0.0-rc.0] ion-button ignores target attribute

See original GitHub issue

Bug Report

Ionic version: [x] 4.x

Current behavior: When using ion-button with href and target attributes, <a> tag is created but is missing target attribute.

Expected behavior: targetattribute should be passed to the <a> element inside ion-button

Steps to reproduce:

<ion-button href="/assets/files/FILE.pdf" target="_blank">
    <ion-icon slot="start" name="cloud-download"></ion-icon>
    OPEN IN NEW TAB
</ion-button>

Ionic info:

Ionic:

   ionic (Ionic CLI)             : 4.6.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.0-rc.0
   @angular-devkit/build-angular : 0.11.4
   @angular-devkit/schematics    : 7.1.4
   @angular/cli                  : 7.1.4
   @ionic/angular-toolkit        : 1.2.1

System:

   NodeJS : v11.5.0 (/usr/local/Cellar/node/11.5.0/bin/node)
   npm    : 6.5.0
   OS     : macOS Mojave

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
brandyscarneycommented, Jun 12, 2019

Thank you for the issue! I’ve merged this in via the PR here: https://github.com/ionic-team/ionic/pull/17883

The fixes for this will be in the 4.6.0 release.

2reactions
ericiscommented, Mar 4, 2019

ion-item has the same behavior… ignores passing these attributes on to the <a> tag.

As a result, installed PWAs (web app “Add to Homescreen”) won’t properly use the target="_blank" attribute on ion-button or ion-item and links to sub-domains that share the same primary domain will open as-if they are part of the PWA rather than as-if they are an external link to the application.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[4.0.0-rc.0] ion-button ignores target attribute #16848 - GitHub
When using ion-button with href and target attributes, <a> tag is created but is missing target attribute. Expected behavior: target attribute ...
Read more >
ion-button - Ionic Framework
ion-button provides a clickable element for use anywhere needing standard button functionality. Design and style button elements with custom CSS properties.
Read more >
Browse Javascript Technical Problem Clusters - Code Grepper
Get code examples instantly right from your google search results with the Grepper Chrome Extension.
Read more >
react-papaparse | browser CSV | CSV Processing library - kandi
Implement react-papaparse with how-to, Q&A, fixes, code snippets. kandi ratings - Low support, No Bugs, No Vulnerabilities.
Read more >
javascript - thiscodeWorks - Organizing the best of code online
waitForSelector('#product-attribute-specs-table', {timeout: 0}) const berat ... jQuery.get(imgURL, function(data) { // Get the SVG tag, ignore the rest var ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found