Multiple clickable controls inside ion-item don't work as expected
See original GitHub issueBug Report
Ionic version:
[x] 4.x
Current behavior:
When there are two controls, ion-select and ion-button inside ion-item clicking on ion-button will always open ion-select control.
Expected behavior:
Clicking on a button should trigger the button handler and clicking on the ion-select should trigger opening this select
Steps to reproduce:
- create new blank app using
ionic start myApp blank
- replace the ion-content in the main Home.html template to be as below
<ion-content padding>
<ion-item>
<ion-label position="stacked">
TEST
</ion-label>
<ion-select placeholder="Select One">
<ion-select-option value="f">Female</ion-select-option>
<ion-select-option value="m">Male</ion-select-option>
</ion-select>
<ion-button slot="end" color="primary" (click)="test();">
TEST
</ion-button>
</ion-item>
</ion-content>
- add a test handler function inside Home.ts
- run the app and click on TEST button Note that it will ALWAYS open a select dialog and will never invoke test function
Related code: See above
StackBlitz (https://stackblitz.com)
StackBlitz does not support the latest Ionic v4 releases - see https://github.com/ionic-team/ionic/issues/16354
Ionic info:
Ionic:
ionic (Ionic CLI) : 4.5.0 (/Users/alexryltsov/.nvm/versions/node/v10.14.2/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.0.0-rc.1
@angular-devkit/build-angular : 0.11.4
@angular-devkit/schematics : 7.1.4
@angular/cli : 7.1.4
@ionic/angular-toolkit : 1.2.2
System:
NodeJS : v10.14.2 (/Users/alexryltsov/.nvm/versions/node/v10.14.2/bin/node)
npm : 6.5.0
OS : macOS Mojave
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Button click inside ion-item not working - ionic-v3
Button elements inside a clickable ion-item only work if they have “item-right” or “item-left” attributes. If you have a button in the body...
Read more >ion-item clickable properties not working (Ionic 4)
Best way to go about doing this: Use a transparent ion-button inside of an ion item. HTML/IONIC Code For Button:
Read more >Blog - Crojach Software
We have a simple label which will hold the source of our clicks and two buttons. Let's now add some typescript code to...
Read more >Hyperlinks in Ionic Checkbox Labels - Damir's Corner
Interestingly enough, the hyperlink in a label works just fine if there's no checkbox in the same ion-item . The reason for that...
Read more >Customizing Ionic Apps for Web & Mobile
While this can work and look fine on your targeted devices out of the box, ... But first we need some data we...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had this issue with
ion-datetime
@ryaa. As a quick workaround, you might be able to set theposition
of the ion-select in the scss. This has the downside of making the select not open if you click the label.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.