p-InputMask does not update its 'filled' property when use within a FormGroup #1734

mselerin opened this Issue Jan 4, 2017 · 0 comments


None yet

2 participants

mselerin commented Jan 4, 2017

I'm submitting a ...

[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

Similar closed issue : #1444

Plunkr Case (Bug Reports)

Current behavior
When InputMask is use with a FormGroup and a value is specified before the AfterViewInit hook, the filled style class (i.e. 'ui-inputwrapper-filled') is not set correctly.

See printscreen from #1444

Expected behavior
The_filled_ style class should be set whenever the model is updated, even if it's before the AfterViewInit hook.

Minimal reproduction of the problem with instructions
See the above plunkr.

What is the motivation / use case for changing the behavior?
Forms data could be retrieved before the AfterViewInit is called (for example : some default data).

Proposed fix
In the InputMask component, the filled property could be a simple getter (just like in the InputText component) instead of being updated in several places.

// components/inputmask/inputmask.ts

get filled(): boolean {
   return this.input && this.input.value != '';

Please tell us about your environment:
Windows 8
IntelliJ Idea 2016.3
lastest version of Google Chrome / Firefox

  • Angular version: 2.4.1
  • PrimeNG version: 1.1.3
  • Browser: Chrome 55 | Firefox 50.1.0 | IE 11
  • Language: TypeScript 2.1
@cagataycivici cagataycivici self-assigned this Jan 9, 2017
@cagataycivici cagataycivici added the defect label Jan 9, 2017
@cagataycivici cagataycivici added this to the 2.0 milestone Jan 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment