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

Select falsy values via ngModel - master #12102

Merged
merged 26 commits into from Oct 6, 2022
Merged

Conversation

RivaIvanova
Copy link
Member

@RivaIvanova RivaIvanova commented Sep 19, 2022

Closes #12048

NOTE FOR TESTING :

  • Should be able to select all falsy values except 'undefined', i.e., false, '', 0, NaN, null.

  • For complex data, if there is an item with valueKey=undefined it should be displayed in the dropdown, but cannot be selected.

  • When testing NaN use an additional variable in the ts file

public selectNaN: any = NaN;

<igx-simple-combo [data]="data" [(ngModel)]="selectedValue"></igx-simple-combo>
<button igxButton (click)="selectedValue = selectNaN"> NaN </button>

Assigning it directly in the html file shows an error "Property 'NaN' does not exist on type 'ComboSampleComponent'.ngtsc(2339)" and the variable bound to the ngModel is assumed as 'undefined'.

Screenshot (8)

  • Test IgxSimpleCombo when bound to the ngModel with required attribute set:
    • if required attribute is set, null, undefined, '' should not be selected in IgxSimpleCombo, otherwise, null, '' should be selected.

Additional information (check all that apply):

  • Bug fix
  • New functionality
  • Documentation
  • Demos
  • CI/CD

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them

@RivaIvanova RivaIvanova added 🛠️ status: in-development Issues and PRs with active development on them and removed ❌ status: awaiting-test PRs awaiting manual verification labels Sep 20, 2022
@RivaIvanova RivaIvanova added ❌ status: awaiting-test PRs awaiting manual verification and removed 🛠️ status: in-development Issues and PRs with active development on them labels Sep 21, 2022
@RivaIvanova RivaIvanova changed the title [IgxSimpleCombo] Select falsy values - master Select falsy values via ngModel - master Sep 26, 2022
jackofdiamond5
jackofdiamond5 previously approved these changes Sep 26, 2022
@jackofdiamond5 jackofdiamond5 added the squash-merge Merge PR with "Squash and Merge" option label Sep 26, 2022
@teodosiah teodosiah added 💥 status: in-test PRs currently being tested and removed ❌ status: awaiting-test PRs awaiting manual verification labels Sep 27, 2022
@teodosiah
Copy link
Contributor

When the simple combo is bound to a data source like ['', false, NaN, null, undefined] selecting the 'false' value through the combo's drop-down is throwing an error:
test

@teodosiah teodosiah added ❌ status: not-fixed and removed 💥 status: in-test PRs currently being tested labels Sep 27, 2022
@teodosiah teodosiah added 💥 status: in-test PRs currently being tested ✅ status: verified Applies to PRs that have passed manual verification and removed ❌ status: awaiting-test PRs awaiting manual verification 💥 status: in-test PRs currently being tested labels Oct 5, 2022
@ChronosSF ChronosSF merged commit e05b38d into master Oct 6, 2022
@ChronosSF ChronosSF deleted the rivanova/fix-12048-master branch October 6, 2022 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
simple-combo squash-merge Merge PR with "Squash and Merge" option version: 14.2.x ✅ status: verified Applies to PRs that have passed manual verification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IgxSimpleCombo: select falsy values not working
5 participants