Using v-mask directive on `b-form-input` not transferring to `input` element
See original GitHub issueHello team,
I’m working with the v-mask (v1.3.0) plugin and attempting to use the v-mask
directive on the b-form-input
component like so:
<b-form @submit.stop.prevent="onSubmit">
...
<b-input-group left="Mobile*">
<b-form-input
type="text"
v-model="mobile"
v-mask="'###-###-####'"
placeholder="___-___-____" />
</b-input-group>
...
</b-form>
The v-mask
directive is turned into data-mask
on the actual input
element when everything gets compiled down and mounted to the DOM. I have been able to test this directive on a simple input
element and it works and other custom input elements outside of bootstrap-vue work too (and they do not transform to data-mask
property). I’m wondering if this could be a bug or if it’s expected behavior. Any ideas on what could be going wrong would be greatly appreciated.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:8 (1 by maintainers)
Top Results From Across the Web
How to transform input values using v-mask when building ...
5. Now, go back to our new <input> element and apply v-model . We are also going to now add the v-mask directive,...
Read more >Form Input | Components - BootstrapVue
Create various type inputs such as: text, password, number, url, email, search, range, date and more.
Read more >Vue - directive bind doesn't work on element refresh
User must go to question without mask, then go back and it will work again. After debugging, I know, that element is refreshed,...
Read more >Masking form input values - Adobe Support
Masking form input values ... The cfinput tag mask attribute controls the format of data that can be entered into a text or...
Read more >The Mask for Vue.js - vuejs-tips
The value returned from directive is always masked! When possible, prefer to use input type="tel" to avoid glitch on android devices. What about...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had the same problem using the Awesome Mask, but in my case, I imported wrongly the directives in the main.js file. When I used
Vue.directive('mask', AwesomeMask);
, then every worked.Yes, its easy!
in your b-form-input, set @focus=“checkMask(id, mask)”
create this method and Voialá!