ngx-mask icon indicating copy to clipboard operation
ngx-mask copied to clipboard

inputvalue is null error when calling formControl.reset on hiddenInput mask

Open jonathanayoub opened this issue 3 years ago • 0 comments

Using ngx-mask 12.0.0

Steps to reproduce:

  1. Create a form control (text input) with hiddenInput set to true using Reactive Forms
  2. Enter a value into the control/field
  3. Call control.reset() on the control, or set the control value to null

I receive this error: image

inputValue is null when the following code is executed, causing an exception:

          
 inputValue !== '' && actualResult.length
  ? typeof this.selStart === 'number' && typeof this.selEnd === 'number'
      ? inputValue.length > actualResult.length
          ? actualResult.splice(this.selStart, 0, getSymbol)
          : inputValue.length 

jonathanayoub avatar Jan 13 '22 19:01 jonathanayoub