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(select): ensure popover options with number values are searched for correctly #23998

Merged
merged 5 commits into from
Oct 4, 2021

Conversation

averyjohnston
Copy link
Contributor

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Build (npm run build) was run locally and any changes were pushed
  • Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: Resolves #23856

When clicking an option with a number value in a popover (ex: value="5"), the dropdown doesn't dismiss and the value isn't updated.

What is the new behavior?

  • When getting which option was clicked, the value for the clicked option is now casted to a string to mirror the values being checked against. (Before, if the option had value="5", the find loop would check "5" === 5 so no option was ever found.)
  • Code DRY'd up somewhat by pulling repeat find loops into a separate helper function.

Does this introduce a breaking change?

  • Yes
  • No

Other information

@github-actions github-actions bot added the package: core @ionic/core package label Sep 29, 2021
@liamdebeasi liamdebeasi changed the title fix(select): ensure popover options w/ number values are searched for correctly fix(select): ensure popover options with number values are searched for correctly Oct 4, 2021
Copy link
Contributor

@liamdebeasi liamdebeasi left a comment

Choose a reason for hiding this comment

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

Great job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants