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): correctly handle reset value when multiple is on #2815

Merged
merged 4 commits into from
Aug 27, 2021

Conversation

chirichok98
Copy link
Contributor

@chirichok98 chirichok98 commented Aug 4, 2021

Please read and mark the following check list before creating a pull request:

Short description of what this resolves:

Fixes #1950. Fixes #2484.

Before fix:
form.reset() sets null for each control in form and null is not an array. Error was produced.

After fix:
When select is multiple we have additional check on null and undefined (in this case value will be empty array)

Copy link
Contributor

@yggg yggg left a comment

Choose a reason for hiding this comment

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

Please, could you also check if autocomplete has the same problem? And if so, fix it as well.

src/framework/theme/components/select/select.component.ts Outdated Show resolved Hide resolved
src/framework/theme/components/select/select.component.ts Outdated Show resolved Hide resolved
src/framework/theme/components/select/select.component.ts Outdated Show resolved Hide resolved
@yggg yggg changed the title fix(nb-select): no error on reset with mulitple fix(select): correctly handle reset value when multiple is on Aug 6, 2021
@chirichok98 chirichok98 force-pushed the fix/1950_select_multiple_control_reset branch from a92c531 to f929182 Compare August 8, 2021 00:18
Copy link
Contributor Author

@chirichok98 chirichok98 left a comment

Choose a reason for hiding this comment

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

Comments were fixed. Added return for empty value on selectValue.

@chirichok98
Copy link
Contributor Author

Please, could you also check if autocomplete has the same problem? And if so, fix it as well.

We have no possibility there to choose multiple items. Nothing to fix.

Copy link
Contributor Author

@chirichok98 chirichok98 left a comment

Choose a reason for hiding this comment

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

Reviewed and applied change request

@yggg yggg merged commit 37a0bc2 into akveo:master Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants