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

default value for ngModel is [] even when multiple is set to false. #293

Open
vikas112dubey opened this issue Oct 15, 2024 · 0 comments
Open

Comments

@vikas112dubey
Copy link

vikas112dubey commented Oct 15, 2024

ngModel value is set to empty array '[]' even when the mutliple flag is set to false.
I am trying to use this library for a very simple use case and i came across this issue. Below is something similar I am doing

<ngx-select-dropdown
[(ngModel)]="myModel"
[multiple]="false"
(change)="onChange($event)"
[options]="myOptions"
[config]="config">

with just above, I notice that myModel's default value is set to [] by the library. It is very unusual where the multiple selection is not required.

Expected result

Default value for the model where multiple is not defined should be set to undefined unless set otherwise.
value of myModel is undefined.

Actual result

value of myModel is []

  • Version used:
  • Browser Name and version: Chrome - 3.3.1
  • Operating System and version: Windows 10 Enterprise
  • Link to your project:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant