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

IgxCombo: Cannot select falsy values #11610

Closed
Timmeeeey opened this issue May 24, 2022 · 4 comments · Fixed by #11861
Closed

IgxCombo: Cannot select falsy values #11610

Timmeeeey opened this issue May 24, 2022 · 4 comments · Fixed by #11861
Assignees
Labels
🐛 bug Any issue that describes a bug 📉 regression combo 🔥 severity: high simple-combo version: 13.2.x ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged.

Comments

@Timmeeeey
Copy link

Description

IgxCombo can't select items with falsy values like false, null or empty string.

Related to #11357

  • igniteui-angular version: 13.1.16
  • browser: Chrome

Result

Falsy values can't be selected.

Expected result

Falsy values should be selectable.

Attachments

https://stackblitz.com/edit/angular-obbbi4

@Timmeeeey Timmeeeey added the 🐛 bug Any issue that describes a bug label May 24, 2022
@teodosiah teodosiah assigned RivaIvanova and teodosiah and unassigned Lipata May 26, 2022
@RivaIvanova RivaIvanova added 🛠️ status: in-development Issues and PRs with active development on them and removed 🆕 status: new labels May 26, 2022
@RivaIvanova RivaIvanova added ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged. and removed 🛠️ status: in-development Issues and PRs with active development on them labels Jun 20, 2022
@RivaIvanova
Copy link
Member

@Timmeeeey, the described behavior is expected as while the display key (i.e., field) can be a falsy value, the value key (i.e., value) cannot, since it is used by the selection service as an identifier to determine what item should be added to the selection.

Having this in mind, in the newly introduced fix, items with falsy value keys will not be displayed in the combo in order not to confuse the users.

@Timmeeeey
Copy link
Author

Hi, you said it is expected behaviour but is it intended?
I have a use case where I have to select objects with falsy value.

@kdinev
Copy link
Member

kdinev commented Jun 20, 2022

@Timmeeeey Actually, the functionality should be the opposite of what @RivaIvanova is describing. Search should be performed by display value - it's what users see, so it makes sense search to search by the values they see - and display values should always be strings, so the only falsy value possibly there is ''. Selection on the other hand is performed by value key, which should be unique and should allow any type of falsy value, as long as they are unique in the set provided.

@Timmeeeey Your example is perfectly valid and it should work!

@RivaIvanova I looked over the PR and I believe a different fix should be applied.

@teodosiah teodosiah added 🛠️ status: in-development Issues and PRs with active development on them and removed ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged. labels Jun 21, 2022
@RivaIvanova RivaIvanova added ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged. and removed 🛠️ status: in-development Issues and PRs with active development on them labels Jul 5, 2022
@kdinev
Copy link
Member

kdinev commented Jul 12, 2022

This issue is a regression introduced with #11206

@kdinev kdinev self-assigned this Jul 14, 2022
@kdinev kdinev added 🛠️ status: in-development Issues and PRs with active development on them and removed ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged. labels Jul 14, 2022
kdinev added a commit that referenced this issue Jul 14, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@RivaIvanova RivaIvanova added ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged. and removed 🛠️ status: in-development Issues and PRs with active development on them labels Jul 18, 2022
Lipata added a commit that referenced this issue Jul 20, 2022
fix(combo): selectable unique falsy values #11610
Lipata added a commit that referenced this issue Jul 20, 2022
fix(combo): selectable unique falsy values #11610
Lipata added a commit that referenced this issue Jul 20, 2022
fix(combo): selectable unique falsy values #11610
Lipata added a commit that referenced this issue Jul 20, 2022
fix(combo): selectable unique falsy values #11610
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Any issue that describes a bug 📉 regression combo 🔥 severity: high simple-combo version: 13.2.x ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged.
Projects
None yet
5 participants