bug: ion-item multiple-inputs does not work when inputs wrapped
See original GitHub issuePrerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
- v4.x
- v5.x
- v6.x
- Nightly
Current Behavior
When I have a button and checkbox inside ion-buttons in ion-item, checkbox width is forced so that it covers the button too, so that button clicks are regarded as checkbox clicks.
The only slightly related issue I could find is this bugfix from Ionic 4 https://github.com/ionic-team/ionic-framework/issues/15850 where @brandyscarney links a workaround for button + input, but that workaround is not working for Ionic 5.
Expected Behavior
It should be possible to affect checkbox’s width so that native element is not forced to be wider than the actual checkbox.
Steps to Reproduce
If I wrap the elements with div instead of ion-buttons, issue persists. If I don’t wrap the two elements in anything, then it works correctly. I managed to achieve the desired style by slot=“end” and adding individual css classes, but it would be more convenient if it was possible to use any kind of wrapping.
<ion-item>
<ion-buttons> </ion-buttons>
<ion-label>wrong</ion-label>
<ion-buttons slot="end">
<ion-button size="small" fill="clear">
<ion-icon name="information-circle"></ion-icon>
</ion-button>
<ion-checkbox></ion-checkbox>
</ion-buttons>
</ion-item>
Code Reproduction URL
https://stackblitz.com/edit/ionic-5-angular-10-start-template-lu7yap?file=src/app/app.component.html
Ionic Info
Ionic:
Ionic CLI : 6.18.1 Ionic Framework : @ionic/angular 5.8.4 @angular-devkit/build-angular : 12.2.13 @angular-devkit/schematics : 12.2.13 @angular/cli : 12.2.13 @ionic/angular-toolkit : 5.0.3
Utility:
cordova-res : not installed globally native-run : 1.5.0
System:
NodeJS : v16.10.0 (C:\Program Files\nodejs\node.exe) npm : 7.24.0 OS : Windows 10
Additional Information
No response
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Multiple items will also be fixed with this. Specifically, we will be removing this logic: https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/item/item.tsx#L237. This is the code that triggers the multiple interactive issue you are running into.
The item component is tightly coupled with form components. The changes I described above will allow us to de-couple item from the form components.
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.