Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: ion-button inside of an ion-label not clickable in v6 #24215

Closed
4 of 6 tasks
kensodemann opened this issue Nov 12, 2021 · 4 comments
Closed
4 of 6 tasks

bug: ion-button inside of an ion-label not clickable in v6 #24215

kensodemann opened this issue Nov 12, 2021 · 4 comments
Labels
package: core @ionic/core package type: bug a confirmed bug report v6 issues specific to Framework v6

Comments

@kensodemann
Copy link
Member

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x

Current Behavior

If you have something like this:

<ion-item>
  <ion-label>
    <ion-button expand="block" @click="doit('In a Label')">In a Label</ion-button>
  </ion-label>
</ion-item>

The click event will not fire on the button in Ionic v6.

It does work if I do this:

<ion-item>
  <div style="flex: auto">
    <ion-button expand="block" @click="doit('In a Label')">In a Label</ion-button>
  </div>
</ion-item>

Which is fine. The only reason I was using ion-label in the first place was so the expand="block" on the button would expand into something that took up the width of the screen.

Expected Behavior

Click event would fire, just like in v5.

I doubt this comes up much IRL, it seems like a odd construct to have a list of buttons like that outside of an app that is demoing various features of another thing, so I am totally cool with switching the to use the div that expands.

Steps to Reproduce

The the code repro provided below. Run as-is it will show it working properly in v5. Then do an npm i @ionic/{vue,vue-router}@next to see the issue.

Code Reproduction URL

https://github.com/kensodemann/test-button-list

Ionic Info

Ionic:

Ionic CLI : 6.18.1 (/Users/ken/.volta/tools/image/packages/@ionic/cli/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/vue 6.0.0-rc.2

Capacitor:

Capacitor CLI : 3.3.1
@capacitor/android : not installed
@capacitor/core : 3.3.1
@capacitor/ios : not installed

Utility:

cordova-res : 0.15.3
native-run : 1.5.0

System:

NodeJS : v16.13.0 (/Users/ken/.volta/tools/image/node/16.13.0/bin/node)
npm : 8.1.3
OS : macOS Monterey

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Nov 12, 2021
@liamdebeasi
Copy link
Contributor

This commit caused the issue: 2c07a15#diff-c74ddc9584918db0c15a8ba1db280abfe14e7f7632b84e1dfbf74ce86315c6c3R315

Pointer events should not be disabled on the label in this case. We should find another way to ensure the select interface is clickable w/ the label.

@liamdebeasi liamdebeasi added package: core @ionic/core package type: bug a confirmed bug report v6 issues specific to Framework v6 labels Nov 12, 2021
@ionitron-bot ionitron-bot bot removed the triage label Nov 12, 2021
@joaoeudes7
Copy link

joaoeudes7 commented Nov 15, 2021

If applied disabled on same component of IonItem all children are disabled

Example:

 <IonItem>
   <IonLabel position="floating">Sinal na Mão Direita *</IonLabel>
   <IonInput disabled={true} name="signalRight" ref={register({ required: true })} />
   <IonButton fill="outline" slot="end" onClick={() => onSelectSinal('right')}>Selecionar</IonButton>
 </IonItem>

The IonButton isnot clickable because of disabled or contentEditable of IonInput

Versions:

 "@ionic/react": "^5.6.13",
 "@capacitor/core": "2.4.7",

@liamdebeasi
Copy link
Contributor

Hi everyone,

This was fixed in #24225, but the linked issue was never closed.

@ionitron-bot
Copy link

ionitron-bot bot commented Jul 9, 2023

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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Jul 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: bug a confirmed bug report v6 issues specific to Framework v6
Projects
None yet
Development

No branches or pull requests

3 participants