You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Logical bug in core library that prevents mask options from updating when new options are a partial of the existing options.
Use case:
Formatted input with show/hide toggle
When wanting to show the values of an input field that are currently hidden by changing the imask blocks configuration, imask fails to update options because of current logic to only apply changes when the new option key/values all existed in the previous, this logic does not pick up when there are omissions.
The logical issue is in updateOptions which calls optionsIsChanged which assumes the options have changed only if they don't exist in the current mask. This doesn't account for if some of the options have been removed, and returns false when the options have changed.
When new options are passed that are a partial of the previous options then only the new options should apply and any configuration that was removed should not persist.
Environment:
OS: All
Browser All
Version: Current
IMask version: 7.6.1
Framework/plugin version if used: Angular (but issue is with core library)
Additional context
Adding unique keys, or changing the structure of the object resolves the issue, but it is not clear that a change like this is required to apply a new mask.
The text was updated successfully, but these errors were encountered:
Describe the bug
Logical bug in core library that prevents mask options from updating when new options are a partial of the existing options.
Use case:
Formatted input with show/hide toggle
When wanting to show the values of an input field that are currently hidden by changing the imask blocks configuration, imask fails to update options because of current logic to only apply changes when the new option key/values all existed in the previous, this logic does not pick up when there are omissions.
The logical issue is in updateOptions which calls optionsIsChanged which assumes the options have changed only if they don't exist in the current mask. This doesn't account for if some of the options have been removed, and returns false when the options have changed.
To Reproduce
https://stackblitz.com/edit/stackblitz-starters-ex7edc?file=src%2Fmain.ts
Expected behavior
When new options are passed that are a partial of the previous options then only the new options should apply and any configuration that was removed should not persist.
Environment:
Additional context
Adding unique keys, or changing the structure of the object resolves the issue, but it is not clear that a change like this is required to apply a new mask.
The text was updated successfully, but these errors were encountered: