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

fix(forms): correct usage of selectedOptions #37620

Conversation

sonukapoor
Copy link
Contributor

@sonukapoor sonukapoor commented Jun 17, 2020

Previously, registerOnChange used hasOwnProperty to identify if the
property is supported. However, this does not work as the selectedOptions
property is an inherited property. This commit fixes this by verifying
the property on the prototype instead.

Closes #37433

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #37433

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@AndrewKushnir AndrewKushnir added area: forms action: review The PR is still awaiting reviews from at least one requested reviewer labels Jun 17, 2020
@ngbot ngbot bot modified the milestone: needsTriage Jun 17, 2020
@AndrewKushnir AndrewKushnir added the target: patch This PR is targeted for the next patch release label Jun 17, 2020
@sonukapoor sonukapoor force-pushed the select-multiple-ie-control-value-accessor branch 2 times, most recently from b101d36 to b43c7ba Compare June 17, 2020 21:44
Previously, `registerOnChange` used `hasOwnProperty` to identify if the
property is supported. However, this does not work as the `selectedOptions`
property is an inherited property. This commit fixes this by verifying
the property on the prototype instead.

Closes angular#37433
@sonukapoor sonukapoor force-pushed the select-multiple-ie-control-value-accessor branch from b43c7ba to 879d676 Compare June 17, 2020 23:09
@sonukapoor sonukapoor marked this pull request as ready for review June 17, 2020 23:10
@pullapprove pullapprove bot requested a review from AndrewKushnir June 17, 2020 23:10
@AndrewKushnir AndrewKushnir added action: presubmit The PR is in need of a google3 presubmit and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jun 17, 2020
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for fixing this @sonukapoor 👍

Also huge thanks to @alfaproject and @CaerusKaru for providing very useful feedback!

@AndrewKushnir
Copy link
Contributor

Presubmit

@AndrewKushnir
Copy link
Contributor

FYI, presubmit went well, marking this PR as ready for merge. Thank you.

@AndrewKushnir AndrewKushnir added action: merge The PR is ready for merge by the caretaker and removed action: presubmit The PR is in need of a google3 presubmit labels Jun 18, 2020
AndrewKushnir pushed a commit that referenced this pull request Jun 25, 2020
Previously, `registerOnChange` used `hasOwnProperty` to identify if the
property is supported. However, this does not work as the `selectedOptions`
property is an inherited property. This commit fixes this by verifying
the property on the prototype instead.

Closes #37433

PR Close #37620
@sonukapoor sonukapoor deleted the select-multiple-ie-control-value-accessor branch June 25, 2020 19:11
@sonukapoor sonukapoor restored the select-multiple-ie-control-value-accessor branch June 25, 2020 19:13
@sonukapoor sonukapoor deleted the select-multiple-ie-control-value-accessor branch June 25, 2020 19:13
@sonukapoor sonukapoor restored the select-multiple-ie-control-value-accessor branch June 25, 2020 19:13
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jul 26, 2020
profanis pushed a commit to profanis/angular that referenced this pull request Sep 5, 2020
Previously, `registerOnChange` used `hasOwnProperty` to identify if the
property is supported. However, this does not work as the `selectedOptions`
property is an inherited property. This commit fixes this by verifying
the property on the prototype instead.

Closes angular#37433

PR Close angular#37620
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: forms cla: yes target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

select_multiple_control_value_accessor uses IE degradation 100% of the time
5 participants