Vizer / ngx-virtual-select-field

Virtual Select Field for Angular Material
MIT License
4 stars 0 forks source link

Value changes not synced to the panel while it's open #2

Closed Klaster1 closed 4 months ago

Klaster1 commented 4 months ago

How to reproduce:

  1. Bind the select value to a form control.
  2. Modify the form control value on value change.
  3. Select a value.

What happens: Trigger value shows the new value. Panel shows the old value.

Expected: Both trigger and panel show the same new value. Regular mat-select works this way too.

Blitz.

Vizer commented 4 months ago

Not sure I have got you right but in a demo you have provided component binds to control but hint renders customOptionHeightValue

Demo:

<mat-hint>Value: {{ customOptionHeightValue }}</mat-hint>

Should be

<mat-hint>Value: {{ control.value }}</mat-hint>

Also in multiselect mode control value should be an array

control = new FormControl<number[]>([0]);
Klaster1 commented 4 months ago

My bad, I messed up the Blitz with all those issues. Here's an updated one and a video. I expected ngx-virtual-select-field (left) to behave in the same manner as mat-select (right).

https://github.com/Vizer/ngx-virtual-select-field/assets/2667662/a77ed8bb-ff18-42d9-a376-049dce390dec