Primeng: .ui-state-filled not set initially when using OnPush and [value] binding

Created on 9 Jun 2017  路  7Comments  路  Source: primefaces/primeng

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)
http://plnkr.co/edit/aOzYbfRSrxc0G0NuiISL?p=preview

Current behavior
when using OnPush, filled inputs with pInputText don't initially have the ui-state-filled css class when setting the value with the [value] binding

Expected behavior
the input should have the ui-state-filled css class

Minimal reproduction of the problem with instructions

  1. open the plunkr above
  2. inspect the input
  3. it does have a value, but it doesn't have the ui-state-filled css class (background is red, if the class is missing)

What is the motivation / use case for changing the behavior?
because it is a bug and it breaks ultima-ng

Please tell us about your environment:
Windows 8.1

  • Angular version: 4.1.3

  • PrimeNG version: 4.0.3

  • Browser: all

  • Language: probably all

Most helpful comment

Our team is considering removing PrimeNG from the project because it does not support initial values for forms. It is sad to see that the issue has been open since 2017 until then and to be a basic usability bug. Any news on this issue?

All 7 comments

I can replicate the issue. The same issue applies for password and textarea components.

Any update if you will merge the PR or fix this bug some other way?

Is there a simpler way to fix it?

I tried many different things and this was the only thing that worked without a drawback.
The only other thing that sort of worked was:

    ngAfterViewInit(){
      setTimeout(() => {
        this.updateFilledState();
        this.cd.markForCheck();
      });
    }

But that resulted in a noticeably flicker for the user.

Any update on this issue?

Our team is considering removing PrimeNG from the project because it does not support initial values for forms. It is sad to see that the issue has been open since 2017 until then and to be a basic usability bug. Any news on this issue?

Unable to replicate with PrimeNG 11.2.2, if the issue persists please create a new ticket with a test case reproducing the issue e.g. stackblitz or a github repo and it will be reviewed by our team once again.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jisqaqov picture jisqaqov  路  3Comments

gatapia picture gatapia  路  3Comments

Helayxa picture Helayxa  路  3Comments

papiroca-tm picture papiroca-tm  路  3Comments

just-paja picture just-paja  路  3Comments