Commit a473e432 authored by Roma's avatar Roma

IE fix

parent 25c0c255
...@@ -35,3 +35,5 @@ You can also get a raw user input text if you want. Then, instead of using v-mod ...@@ -35,3 +35,5 @@ You can also get a raw user input text if you want. Then, instead of using v-mod
## Known issues/TODO ## Known issues/TODO
* Cut in mobile Chrome * Cut in mobile Chrome
* Cyrillic chars are not supported in mobile Chrome * Cyrillic chars are not supported in mobile Chrome
Found more? Open for feedback and pull requests
{ {
"name": "vue-masked-input", "name": "vue-masked-input",
"description": "Masked input component for Vue.js 2.X", "description": "Masked input component for Vue.js 2.X",
"version": "0.2.1", "version": "0.2.2",
"author": "niksmr", "author": "niksmr",
"license": "MIT", "license": "MIT",
"homepage": "https://github.com/niksmr/vue-masked-input", "homepage": "https://github.com/niksmr/vue-masked-input",
......
...@@ -200,10 +200,16 @@ export default { ...@@ -200,10 +200,16 @@ export default {
input(e) { input(e) {
}, },
keyPress(e) { //works only on Desktop //Dirty FF hack keyPress(e) { //works only on Desktop
if (e.ctrlKey) return; if (e.ctrlKey) return; //Fix FF copy/paste issue
if (navigator.userAgent.indexOf('Firefox') != -1 && /*
parseFloat(navigator.userAgent.substring(navigator.userAgent.indexOf('Firefox') + 8)) >= 3.6) { IE & FF are not trigger textInput event, so we have to force it
*/
let isIE = /*@cc_on!@*/false || !!document.documentMode; //by http://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
let isFirefox = typeof InstallTrigger !== 'undefined';
if (isIE || isFirefox) {
e.preventDefault() e.preventDefault()
e.data = e.key e.data = e.key
this.textInput(e) this.textInput(e)
......
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