components icon indicating copy to clipboard operation
components copied to clipboard

bug(mdc-chip-grid): Autocompleted chip-grid does not work with custom display function

Open Neloop opened this issue 3 years ago • 0 comments

Is this a regression?

  • [X] Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

14

Description

In version 14 we created auto-completed chip-grid with form-control which contains objects as values and not strings, the values were displayed with custom function and it worked great. But it stopped working in mdc components in version 15.

The problem is that after focus is moved from chip-grid, values in chip-grid changes, they are nulled, or set to empty string. But even if I set initial value as array into form-control something automatically changes it to comma separated string. Please see stackblitz below.

Reproduction

Steps to reproduce:

  1. Open stackblitz https://components-issue-doytbf.stackblitz.io
  2. Add value to the chip-grid by selecting some value from the autocomplete list
  3. If you try to add second value from the list or move focus from chip-grid, the first value is nulled and appears to be empty

Expected Behavior

As pointed out earlier, this worked in 14, values in form-control were correctly stored in array and we could work with those values. But in 15 it seems that value in form-control is automatically changed from array to comma separated string.

Actual Behavior

image

Environment

  • Angular: 15.0.0
  • CDK/Material: 15.0.0
  • Browser(s): latest FF
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows

Neloop avatar Nov 24 '22 12:11 Neloop