RonaldJerez / vue-input-facade

A lightweight and dependency free input masking library created specific for Vue
https://ronaldjerez.github.io/vue-input-facade/latest/
183 stars 27 forks source link

Allow entering static character at start #34

Closed killroyboy closed 3 years ago

killroyboy commented 3 years ago

Describe the bug Users are unable to type a mask static character if it's the first character of the mask. For instance, if I have a mask for a US phone, (###) ###-####, and the user starts typing an open parenthesis, it just rejects it and nothing happens. The user assumes something is broken.

To Reproduce

  1. Go to https://ronaldjerez.github.io/vue-input-facade/#!/InputFacade/1
  2. Remove the default phone number
  3. Attempt to type the open parenthesis. Nothing appears.

Expected behavior Users should be able to type static characters and they should appear.

Desktop (please complete the following information):

RonaldJerez commented 3 years ago

As you pointed out the issue is only when the static characters are at the beginning. Using the prefill option could solve this, is there a reason you did not use that prop?

killroyboy commented 3 years ago

As you pointed out the issue is only when the static characters are at the beginning. Using the prefill option could solve this, is there a reason you did not use that prop?

I can't use the custom component and as far as I could tell, it wasn't available at the directive level. I tried adding it into the options for Vue.use, but it didn't have any effect.

It also felt like a bug rather than a setting that should be changed to make it work.

RonaldJerez commented 3 years ago

Sorry it took so long to review and merge, been a very busy few couple of weeks. Thanks for the pull request.

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 1.3.5 :tada:

The release is available on:

Your semantic-release bot :package::rocket: