IgniteUI / igniteui-angular

Ignite UI for Angular is a complete library of Angular-native, Material-based Angular UI components with the fastest grids and charts, Pivot Grid, Dock Manager, Hierarchical Grid, and more.
https://www.infragistics.com/products/ignite-ui-angular
Other
568 stars 159 forks source link

fix(combo): Handle selection when placed in an IgxGrid cell template and grid is virtualized - master #14414

Closed ddaribo closed 2 days ago

ddaribo commented 1 week ago

Closes #14305

Additional information (check all that apply):

Checklist:

RivaIvanova commented 1 week ago

There are two strange behaviors:

  1. Usually when opening the combo without a selected item, the first item is focused, however, when opening the combo on the 11th row (which let's say corresponds to the combo in the 1st row), the item that was selected in the 1st combo is focused in the 11th combo.
  2. Once I select a value, I cannot deselect it. If I click the clear button, scroll down/up, and return to the combo the previous value is selected.

igx-simple-combo-in-grid

ddaribo commented 5 days ago

@RivaIvanova,

After further investigation, I believe these behaviors have to be addressed on the sample level. I’ve already logged an issue in igniteui-angular-samples (it is linked in the current PR’s issue also). More details are listed in its description. There is a pending PR for that as well.

To sum up, IMO the sample has to be adapted to support a virtualized scenario and the introduced changes will address the behaviors you have observed. Please, do test this branch along with the refactored sample (and by adding more records). This leaves this PR’s main task to resolve the error that was raised when scrolling a grid with templated combos with changing IDs, whose selection sets were not properly initialized in that case. I have also added commits that ensure closing the combo and losing its input focus when the ID is changing, for example while scorlling the grid.