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.

Multiple clickable controls inside ion-item don't work as expected

See original GitHub issue

Bug 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:

  1. create new blank app using
ionic start myApp blank
  1. 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>
  1. add a test handler function inside Home.ts
  2. 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:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
zakton5commented, Jan 24, 2019

I had this issue with ion-datetime @ryaa. As a quick workaround, you might be able to set the position of the ion-select in the scss. This has the downside of making the select not open if you click the label.

ion-select {
  position: relative;
}
0reactions
ionitron-bot[bot]commented, Mar 15, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

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