Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mselerin opened this issue Jan 4, 2017 · 0 comments
Closed
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@mselerin
Copy link
Contributor

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)
http://plnkr.co/edit/d7ZpJl

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
npm
webpack-dev-server
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 added a commit that referenced this issue Jan 9, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Proposed fix for #1734
@cagataycivici cagataycivici self-assigned this Jan 9, 2017
@cagataycivici cagataycivici added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working 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
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants