-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
[fix](alert, actionSheet, picker and toast): Call pressed button handler, regardless 'role' #28952
Closed
+314
−28
Closed
Changes from 5 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
5bfcd13
[fix](alert): call pressed button handler, regardless 'role'
joselrio 4ce2e61
[fix](alert): rollback unintended removed line.
joselrio 708ad15
[fix](alert): update to improve code readability.
joselrio e47e139
Merge branch 'main' into alert-cancel-buttons-update
joselrio 07236f1
[fix](alert): Run lint.fix after PR test-core-lint fail.
joselrio 570270b
[fix](alert): Adding validation if button handler returns false.
joselrio 2be3bd9
[fix](action-sheet): call pressed button handler, regardless 'role'
joselrio 42e0c83
[fix](picker): call pressed button handler, regardless 'role'
joselrio 14ba21b
[fix](toast): call pressed button handler, regardless 'role'
joselrio 958a4fa
Merge branch 'main' into alert-cancel-buttons-update
joselrio 69bf9a2
[fix](alert): Tests to ensure proper handler is triggered
joselrio 23531b4
Merge branch 'main' into alert-cancel-buttons-update
joselrio 693a2c3
[fix](alert): lint.fix
joselrio 2d9761c
[fix](alert): Method renamed.
joselrio 610e275
[fix](picker): Tests to ensure proper handler is triggered.
joselrio 6135478
[fix](alert): lint
joselrio 0edd1a0
[fix](alert): Split cancel buttons tests.
joselrio 6967dda
[fix](picker): Split cancel buttons tests.
joselrio 621d6b2
[fix](toast): Tests to ensure proper handler is triggered.
joselrio f01cabe
[fix](toast): Removed unused property.
joselrio b0910ed
[fix](toast): Fixed test issues and add screenshots.
joselrio d05e653
[fix](alert): Added screenshot test.
joselrio 6ce83c4
[fix](picker): Added screenshot test.
joselrio bbd9cda
[fix](toast): Fixed screenshot and test names.
joselrio 91b5b8b
test(picker): cancel button handler is called
sean-perkins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll need to ask the team, but this change does change the current behavior of a
cancel
role button with a custom handler that returnsfalse
.Previously, it would have dismissed the overlay. With the proposed changes it would not dismiss.
I think the change in behavior is valid/expected, but never hurts to get a second opinion 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello! After speaking with the team, I'd advise we adjust the implementation pattern here. We should de-risk and validate a use case for needing to prevent a dismiss with a cancel role, before making that change.
The proposed fix for the original issue should execute the handler callback, but not prevent dismissing. Something to the effect of:
While investigating this issue further, I found that
ion-action-sheet
,ion-picker
, andion-toast
all have very similar implementations and likely the same problematic behavior.We can discuss more in Slack, but I think addressing the fix across all these implementations would be great to knock out together, once we validate the path for one. I can help out here if desired.