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: stopPropagation is ignored in ion-checkbox #30241

Open
3 tasks done
pkunszt opened this issue Mar 12, 2025 · 0 comments
Open
3 tasks done

bug: stopPropagation is ignored in ion-checkbox #30241

pkunszt opened this issue Mar 12, 2025 · 0 comments
Labels

Comments

@pkunszt
Copy link

pkunszt commented Mar 12, 2025

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

Currently in the following setting

          <ion-item>
            <ion-checkbox label-placement="start"  justify="space-between">
              Description
            <ion-icon name="help-circle-outline"
                      (click)="help('Help Text', $event)"></ion-icon>
            </ion-checkbox>
          </ion-item>

A call to stopPropagation inside the help() function will still trigger the whole ion-item + ion-checkbox.

Expected Behavior

From stopPropagation i would expect that it does just that. This is currently not working, therefore the bug.
In the previous setup with the old ion-checkbox where i had an ion-label with the same help() function, this was not a problem, even though the click event was on the ion-item to make sure it behaves as fully clickable as expected on mobile.

This might be related to, but not the same as #20521 which was tagged a design decision. The workaround there does not work for this, i would need to place the help icon outside of the label - either to the beginning or the end of the ion-item which would break my app design and is not what i want. And it did work previously with ion-label instead of the checkbox built-in label.

Steps to Reproduce

See the description above. Run the code in the github repo given.
Then click on the question mark. You will see the checkbox being checked. It should not be doing that, due to the stopPropagation() in the code.

Code Reproduction URL

https://github.com/pkunszt/ionic-checkbox-issue

Ionic Info

Ionic:

Ionic CLI : 7.2.0 (/opt/homebrew/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 8.4.3
@angular-devkit/build-angular : 19.2.1
@angular-devkit/schematics : 19.2.1
@angular/cli : 19.2.1
@ionic/angular-toolkit : 12.1.1

Utility:

cordova-res : 0.15.4
native-run : not installed globally

System:

NodeJS : v23.9.0 (/opt/homebrew/Cellar/node/23.9.0/bin/node)
npm : 10.9.2
OS : macOS Sequoia 15.1.1 (added manually as this was undefined in the run)

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant