-
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(select): emit single ionChange event for popover option selection #26796
fix(select): emit single ionChange event for popover option selection #26796
Conversation
Run & review this pull request in StackBlitz Codeflow. |
Not a huge fan of the PR title, open to ideas. |
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.
Can you add some more context as to why the proposed fix works? Also, why did we only change ion-checkbox
and not ion-radio
?
For checkboxes that do not render the label immediately next to the checkbox, developers may continue to use "ion-label" but must manually associate the label with the checkbox by using "aria-labelledby".`, | ||
For checkboxes that do not render the label immediately next to the checkbox, developers may continue to use "ion-label" but must manually associate the label with the checkbox by using "aria-labelledby". | ||
|
||
Developers can use the "legacy" property to continue using the legacy form markup. This property will be removed in an upcoming major release of Ionic where this form control will use the modern form markup.`, |
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.
If we are good with the wording here, I can follow-up with another PR to apply across all form controls for v7.
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.
Looks good 👍
core/src/components/select-popover/test/basic/select-popover.e2e.ts
Outdated
Show resolved
Hide resolved
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.
Great job!
Pull request checklist
Please check if your PR fulfills the following requirements:
ionic-docs
repo, in a separate PR. See the contributing guide for details.npm run build
) was run locally and any changes were pushednpm run lint
) has passed locally and any fixes were made for failuresPull request type
Please check the type of change your PR introduces:
What is the current behavior?
ion-select
withinterface="popover"
, selecting an option will result in a duplicate emission of theionChange
event.The duplicate emission issue spawns from: #23474
The root problem was that we had both a click handler on the radio and a
@Listen
decorator forionChange
, both invoking the callback handler for the popover options. When a radio is selected, it would fire the click handler directly attached to the element and then theion-radio-group
would fire anionChange
event, additionally executing the callback handler (again).Issue URL: Resolves #26789 (this issue is resolved as a result, but the problem is existent with a basic implementation in v7 beta).
What is the new behavior?
<ion-select interface="popover">
emits a singleionChange
event when an option is selected from single selectionany
types within theSelectPopover
classselect
)ion-select-popover
ion-checkbox
to include information for developers to use thelegacy
prop if they require the legacy form templateDoes this introduce a breaking change?
Other information
Dev-build:
7.0.0-dev.11676402953.118c3b36