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 not updating #1868

Closed
ghost opened this issue Jan 20, 2017 · 1 comment
Closed

p-inputMask not updating #1868

ghost opened this issue Jan 20, 2017 · 1 comment
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@ghost
Copy link

ghost commented Jan 20, 2017

[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 demonstrating buggy behavior:
http://plnkr.co/edit/RtXeArlvLaLE3GCr3r6y?p=preview

Current behavior
When I exchange the two-way bound model variable of a p-inputmask's value from a defined value to undefined the component's value is not updated. Possilby related, the initial value isn't shown either.

Expected behavior
When the value of a p-inputmask becomes undefined the component should update and show the mask for an empty field.
This bug is a regression from primeng version 1.1.0->1.1.4
Use the provided plunkr to verify correct behavior in primeng 1.1.0

Minimal reproduction of the problem with instructions
See plunkr above, or:
Create a p-inputmask with a two-way bound value. Set the value to something matching the mask, and then programmatically change it to undefined.

Possible fix:
this commit f992187a5ee2f45d8dab44816634dbba5a150a50 moved "this.checkVal()" into the else block. Moving it behind should fix this issue, although i can't tell if that breaks the animation the commit fixed.

Please tell us about your environment:

  • Angular version: 2.4.3
  • PrimeNG version: 1.1.4
  • Browser: Chrome 55.0.2883.87 m (64-bit) | Firefox 45.6.0
  • Language: TypeScript 2.0.8
@ghost ghost mentioned this issue Jan 20, 2017
@cagataycivici cagataycivici changed the title p-inputMask not updating if model becomes undefined p-inputMask not updating Feb 6, 2017
@cagataycivici cagataycivici self-assigned this Feb 6, 2017
@cagataycivici cagataycivici added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Feb 6, 2017
@cagataycivici cagataycivici added this to the 2.0-Final milestone Feb 6, 2017
@rafaelodon
Copy link

The problem is still occuring in 2.0.2. I believe the "this.checkVal();" line was mistakenly moved to inside an "else" block.

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