Describe the bug
The mask on a date picker is lost after updated is called on the component.
The teardown method is causing this.element.data('mask') to return "" instead of undefined, so the mask doesn't get re-inited here.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The mask should still work after updated is called on the datepicker component.
Version
Screenshots

Platform
The problem is here https://github.com/infor-design/enterprise/blob/master/src/components/datepicker/datepicker.js#L418 as after the component is detroyed the mask variable is set to empty string not undefined and will never reinvoke the mask.
The fix should be to move this line https://github.com/infor-design/enterprise/blob/master/src/components/datepicker/datepicker.js#L1639
Down a bit to after https://github.com/infor-design/enterprise/blob/master/src/components/datepicker/datepicker.js#L1654
And set it to undefined not empty string. Seems like even the mask is not getting destroyed.
@lipetzan I know this is in our upcoming release to customers. Which I believe uses EP 4.21. Do we need a patch for this or can it wait until next CU?
Just let me know asap i can do either a 4.21 patch or just add it in 4.22 which freezes EOM
Please add some unit tests for form field masks. Adding a tag for that.
There are tests for mask but not the case of doing a destroy and then reinvoking. Adding a test on the PR... Incomming
We added a tag "for customer". We didnt want to increase the number of tags as we have a system in place.
What are these new tags for?
Removing these new tags as they dont make sense to us. But let me know what the purpose as and we can try to fit it into our system. Just let me know if you need a tag and what for.
"There are tests for mask but not the case of doing a destroy and then reinvoking. Adding a test on the PR... Incomming"
@tmcconechy We probably need test for all components updated() functions that destroy and then reinvoke. But that's not in the scope of this ticket
That would be a separate issue. Feel free to raise. Many should be there but would be a tad bit of work to check every single component and make sure there is a test like that for each of them.
http://master-enterprise.demo.design.infor.com/components/datepicker/test-mask-after-update.html
Passed QA testing in all browsers. Also retested http://master-enterprise.demo.design.infor.com/components/datepicker/example-validation.html.