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",
"main": "src/MaskedInput.vue", "main": "src/MaskedInput.vue",
"scripts": { "scripts": {
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --inline --hot", "dev": "cross-env NODE_ENV=development webpack-dev-server --open --inline --hot",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules" "build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/niksmr/vue-masked-input.git" "url": "git+https://github.com/niksmr/vue-masked-input.git"
}, },
"keywords": [ "keywords": [
"vue", "vue",
"mask", "mask",
"masked", "masked",
"input" "input"
], ],
"dependencies": { "dependencies": {
"inputmask-core": "^2.2.0", "inputmask-core": "^2.2.0",
"vue": "^2.1.0" "vue": "^2.1.0"
}, },
"devDependencies": { "devDependencies": {
"babel-core": "^6.0.0", "babel-core": "^6.0.0",
"babel-loader": "^6.0.0", "babel-loader": "^6.0.0",
"babel-preset-es2015": "^6.0.0", "babel-preset-es2015": "^6.0.0",
"cross-env": "^3.0.0", "cross-env": "^3.0.0",
"css-loader": "^0.25.0", "css-loader": "^0.25.0",
"file-loader": "^0.9.0", "file-loader": "^0.9.0",
"vue-loader": "^10.0.0", "vue-loader": "^10.0.0",
"vue-template-compiler": "^2.1.0", "vue-template-compiler": "^2.1.0",
"webpack": "^2.2.0", "webpack": "^2.2.0",
"webpack-dev-server": "^2.2.0" "webpack-dev-server": "^2.2.0"
} }
} }
...@@ -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