primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Chips float label does not work when value is updated programmatically

Open MaksymShchukin opened this issue 6 years ago • 4 comments

I'm submitting a ... (check one with "x")

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports) Please demonstrate your case at stackblitz by using the issue template below. Issues without a test case have much less possibility to be reviewd in detail and assisted.

https://stackblitz.com/github/primefaces/primeng-issue-template

Couldn't get stackblitz to work, but here you can find repro project here https://github.com/MaximShchukin/primeng-chips-issue2

Current behavior https://prnt.sc/uiwip0 Chips float label does not "float" when form value is updated programmatically

Expected behavior Float label works correctly with Chips

Minimal reproduction of the problem with instructions

  1. Create form with Chips control and float label
  2. try to update value programmatically like this: this.form.patchValue({ cities: ["London", "New York"] });

What is the motivation / use case for changing the behavior? We want to use float labels with Chips

Please tell us about your environment: Windows, Visual Studio Code

  • Angular version: 5.X Angular 10.1.2

  • PrimeNG version: 5.X PrimeNG 10.0.0

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ] all

  • Language: [all | TypeScript X.X | ES6/7 | ES5] Typescript 4.0.2

  • Node (for AoT issues): node --version =

MaksymShchukin avatar Sep 17 '20 13:09 MaksymShchukin

Here's a sample of the issue: https://stackblitz.com/edit/github-hzsp8u

MaksymShchukin avatar Sep 24 '20 09:09 MaksymShchukin

The same issue with PrimeNg 11. @MaximShchukin did you find the workaround how to fix it?

KonstantinsS avatar Apr 01 '21 06:04 KonstantinsS

The same issue with PrimeNg 11. @MaximShchukin did you find the workaround how to fix it?

The workaround would be to add class p-inputwrapper-filled to p-chip element.

KonstantinsS avatar Apr 12 '21 14:04 KonstantinsS

This bug is still in master branch. As I understand, the solution is just to add this.updateFilledState() call into writeValue method. Could you fix it, please? Thank you!

iskalyakin avatar Jul 29 '21 10:07 iskalyakin