Comments (7)
Hi, @Samuell1
You can delete separating chars right now without any issue.
I don't understand your question. Can you please, explain it deeper?
I'd like to solve the issue you have but I need more information
from v-mask.
When I try to delete text AA-####-AAAA and I start deleting using backspace from the last char, deleting stops at AA-####- ...IDK how to explain it better way, I am simply not able to delete that separator (-) without highlighting the whole AA-####-AAAA or moving behind separator with arrows on my keyboard or mouse.
from v-mask.
So, format is: AA-####-AAAA
And you are typing something like: sA-4254-DbtZ
Then you try to delete chars with backspace and you suck at sA-4254-
, right?
Btw, what version are you using? For Vue 2.X or Vue 1.X?
from v-mask.
I am using Vue 2 and I am using only your function format() in my own custom component on input tag
from v-mask.
So, the issue is not in v-mask
. But in your implementation.
Check here how I have solved the issue
In short, I have cached the length. If the previous length is longer then new one I don't call format
at all. Because in this case, Backspace/Del was pressed.
Btw, v-mask
now supports Vue 2.0
from v-mask.
I think i have same function for changing value for input
var new_value = value
if (this.mask) {
var previous = ''
if (previous.length < value.length) {
new_value = this.format(value, this.mask)
previous = new_value
}
}
this.currentValue = new_value
from v-mask.
I find it! previous.length every time returning 0 :D . I edited it to
var new_value = value
if (this.mask) {
if (this.previousValue.length < value.length) {
new_value = this.format(value, this.mask)
}
this.previousValue = new_value
}
this.currentValue = new_value
from v-mask.
Related Issues (20)
- Underscores ("_") break all masking HOT 2
- Dependency Dashboard
- Error using v-mask function in vuetify component HOT 2
- The mask doesn't work when you manually replace selected text HOT 1
- e.initEvent is deprecated
- Place holder optional (?) not working HOT 1
- How to deal with ip addresses HOT 3
- Is it possible to use pipes? HOT 1
- mask not working with ctrl a + ctrl v HOT 2
- The last 4 digits of the phone number are not hidden. The first 4 digits at the beginning of the number go to the end.
- Using v-mask in a text-area field HOT 1
- Editing v-text-field with phone number mask (NNN) NNN-NNNN causes cursor to move to end of field
- Masked input affected by typing in another field in case using function for v-mask HOT 1
- Bug when replacing through selection #1
- Bug when replacing through selection #2
- Vue.filter is not a function ? HOT 3
- input with mask cut value and add some number
- Prevent field clean when changing mask
- The automated release is failing 🚨
- Question / Feature : Help Needed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from v-mask.