bug: ion-select doesn't work inside a ion-item tag
See original GitHub issueBug Report
Current behavior:
Implementing a ion-select
inside a ion-item
tag, but upon clicking, nothing happens.
If I remove the ion-item
tag, the ion-select
works as expected.
It’s confusing because the Docs shows that you can use a ion-select
under a ion-item
tag.
Expected behavior:
I would expect the ion-select
to work inside a ion-item
tag according to the docs.
Related code:
Works:
<!-- <ion-item> -->
<ion-label>Gender</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-item> -->
<!-- <ion-item> -->
<ion-label>Hair Color</ion-label>
<ion-select value="brown" okText="Okay" cancelText="Dismiss">
<ion-select-option value="brown">Brown</ion-select-option>
<ion-select-option value="blonde">Blonde</ion-select-option>
<ion-select-option value="black">Black</ion-select-option>
<ion-select-option value="red">Red</ion-select-option>
</ion-select>
<!-- </ion-item> -->
Doesn’t work:
<ion-item>
<ion-label>Gender</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-item>
<ion-item>
<ion-label>Hair Color</ion-label>
<ion-select value="brown" okText="Okay" cancelText="Dismiss">
<ion-select-option value="brown">Brown</ion-select-option>
<ion-select-option value="blonde">Blonde</ion-select-option>
<ion-select-option value="black">Black</ion-select-option>
<ion-select-option value="red">Red</ion-select-option>
</ion-select>
</ion-item>
Other information:
Ionic info:
Ionic:
Ionic CLI : 5.4.13 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.11.7
@angular-devkit/build-angular : 0.801.3
@angular-devkit/schematics : 8.1.3
@angular/cli : 8.1.3
@ionic/angular-toolkit : 2.1.1
Utility:
cordova-res : not installed
native-run (update available: 0.3.0) : 0.2.9
System:
NodeJS : v12.13.0
npm : 6.13.4
OS : macOS Mojave
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
bug: ion-select doesn't work inside a ion-item tag #20179
It looks like it has something to do with particular CSS being applied to interactive elements in the Shadow DOM. I am going...
Read more >Button click inside ion-item not working - ionic-v3
Only when I remove the click handler from the ion-item, the button click handler is called. Is this a bug? Or am I...
Read more >i want to add ion-item after an ion option is selected in ion-select
I want to show the Discount Percentage only after I select Total Price Discount. Is there a way? ionic-framework · Share.
Read more >Why Is My Ion-Select Displaying The Wrong Label In Ionic 3
plchampigny opened this issue on Jan 25, 2019 · 11 comments Long ion-select-option should properly size the item and allow the user to...
Read more >5 Examples of the new Ionic 6 Bottom Sheet Modal
Get the details on how to use the brand new Ionic Bottom Sheet component in this guest blog post from Simon Grimm.
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
Thanks for the follow up. I created a reproduction of the same issue without using any Ionic components: https://codepen.io/liamdebeasi/pen/zYxjvdw
It looks like it has something to do with particular CSS being applied to interactive elements in the Shadow DOM. I am going to close this as this does not appear to be a bug in Ionic Framework; however, we will look into reporting this issue to the Firefox team. Thanks!
Hey there, I filed a bug with the Firefox team: https://bugzilla.mozilla.org/show_bug.cgi?id=1640189. Looks like this has been fixed in Firefox 78, so a fix should be available whenever that ships.