import createTextMaskInputElement from '../../core/src/createTextMaskInputElement.js'

export function maskInput(textMaskConfig) {
  const {inputElement} = textMaskConfig
  const textMaskInputElement = createTextMaskInputElement(textMaskConfig)
  const inputHandler = ({target: {value}}) => textMaskInputElement.update(value)

  inputElement.addEventListener('input', inputHandler)

  return {
    textMaskInputElement,

    destroy() {
      inputElement.removeEventListener('input', inputHandler)
    }
  }
}

export default maskInput

@@ -376,16 +376,67 @@
 ndler)%0A%0A
+  textMaskInputElement.update(inputElement.value)%0A%0A
   return

mask initial value (#275)