Commit c051c746 authored by NikulinR's avatar NikulinR

FF fixes

parent 0e88de01
......@@ -26,3 +26,8 @@ If you need to include one of these characters as a static part of the mask, you
```vue
<masked-input v-model="phone" mask="+\\1 (111) 111-1111" placeholder="Phone number" type="tel" />
```
## Known issues/TODO
* Copy/cut/paste in FF
* Copy/cut/paste in mobile Chrome
* Cyrillic chars are not supported in mobile Chrome
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -15,7 +15,7 @@
<li># – alphanumeric, forced to upper case when entered</li>
</ul>
<h4>Date: </h4>
<masked-input v-model="date" mask="11 / 11 / 1111" placeholder="Date" /><span v-if="">{{ date }}</span>
<masked-input v-model="date" mask="11 / 11 / 1111" placeholder="Date"/><span v-if="">{{ date }}</span>
<p class="code">
&lt;masked-input v-model="date" mask="11 / 11 / 1111" placeholder="Date" /&gt;
</p>
......
......@@ -62,7 +62,8 @@ export default {
pattern: this.mask,
value: this.default
})
this.$refs.input.value = this.mask_core.setValue = this.default
this.$refs.input.value = this.default
this.mask_core.setValue(this.default)
this.mask_core.setSelection({
start: 0,
end: 0
......@@ -173,19 +174,28 @@ export default {
}
},
keyPress(e) { //works only on Desktop
input(e) {
},
keyPress(e) { //works only on Desktop //Dirty FF hack
if (navigator.userAgent.indexOf('Firefox') != -1 &&
parseFloat(navigator.userAgent.substring(navigator.userAgent.indexOf('Firefox') + 8)) >= 3.6) {
e.preventDefault()
e.data = e.key
this.textInput(e)
}
},
textInput(e) {
e.preventDefault()
if (e.preventDefault) e.preventDefault()
if (this.mask_core.input(e.data)) {
this.updateToCoreState()
this.updateAfterAll = true
}
this.updateToCoreState()
},
keyUp(e) {
if (this.updateAfterAll) this.updateToCoreState()
this.updateToCoreState()
this.updateAfterAll = false
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment