Skip to content

Conversation

@jdforsythe
Copy link
Contributor

Fix the Objects as Values documentation to add the necessary value
property to the template, simplify the compare function, and add an
interface for type checking.

Add an Objects as Values with Multiple Selection documentation section
to show the difference with the compare function which needs to
determine if an object is in the array of selected objects

This fixes an issue noted in the forums at https://forum.ionicframework.com/t/ionic-5-ion-select-objects-as-values-not-working/191807/2

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: https://forum.ionicframework.com/t/ionic-5-ion-select-objects-as-values-not-working/191807/2

What is the new behavior?

  • Fixes the select "Objects as Values" documentation
  • Adds a select "Objects as Values with Multiple Selection" documentation

Does this introduce a breaking change?

  • Yes
  • No

Other information

This shows the proper addition of a value property to the template, fixing the issue brought up in https://forum.ionicframework.com/t/ionic-5-ion-select-objects-as-values-not-working/191807/2 where the sample comparison function fails (checks all items)

The addition of an example for multiple selection of objects fixes the issue that the sample compare function (for single select) doesn't select any options when re-opening the select because the second parameter (o2 in the sample) is an array.

Fix the Objects as Values documentation to add the necessary value
property to the template, simplify the compare function, and add an
interface for type checking.

Add an Objects as Values with Multiple Selection documentation section
to show the difference with the compare function which needs to
determine if an object is in the array of selected objects

This fixes an issue noted in the forums at https://forum.ionicframework.com/t/ionic-5-ion-select-objects-as-values-not-working/191807/2
@ionitron-bot ionitron-bot bot added the package: core @ionic/core package label Sep 22, 2020
@brandyscarney
Copy link
Member

Thank you for the PR! Could you make this change in the core/src/components/select/usage/angular.md file and then run npm run build inside of the core, directory please? The documentation from the usage section is auto-generated into the readme file. 🙂

For more information please see our contributing file. Thank you!

@jdforsythe
Copy link
Contributor Author

@brandyscarney Thanks, I didn't make it back around to fix this.

@brandyscarney brandyscarney merged commit 66b4d11 into ionic-team:master Oct 2, 2020
@brandyscarney
Copy link
Member

@jdforsythe That's okay! Thank you for the PR. 🙂

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