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.

bug: ion-item multiple-inputs does not work when inputs wrapped

See original GitHub issue

Prerequisites

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.

ion-checkbox-error ion-checkboxx

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:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
liamdebeasicommented, Aug 9, 2022

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.

0reactions
ionitron-bot[bot]commented, Sep 9, 2022

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

ion-item - Ionic Framework
ion-item elements for iOS/Android contain text, icons, images, and other custom elements. They're placed in a list and can be input, deleted, edited,...
Read more >
ion-input not working but input does - Stack Overflow
Looking from you controller code, I believe that you are using ionic v1 but you are looking on ionic v2 documentation for implementation....
Read more >
Icons and Floating Inputs: Ionic - Prototype A - WordPress.com
Now, this sample is very basic. It does not handle multiple inputs so you will need to create a solution to solve that...
Read more >
ion-text-wrap, Ion-item (click event), ionic text-overflow ellipsis ...
The ion-text element should wrap the element in order to change the text color of ... bug: multiple inputs inside of an ion-item...
Read more >
onIonChange is triggering more than one input on Ionic 5 React
I have multiple inputs, each in it's own IonItem. ... problem. as you can see I typed a letter in email but the...
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