mirror of https://github.com/ElemeFE/element
Select: fix readonly problem in edge (#13034)
Cascader select readonly 添加 edge 浏览器判断; src/utils/util.js 添加 isIE, isEdge方法;pull/13084/head
parent
ef397572da
commit
868bbc71e7
|
@ -71,7 +71,7 @@ import emitter from 'element-ui/src/mixins/emitter';
|
||||||
import Locale from 'element-ui/src/mixins/locale';
|
import Locale from 'element-ui/src/mixins/locale';
|
||||||
import { t } from 'element-ui/src/locale';
|
import { t } from 'element-ui/src/locale';
|
||||||
import debounce from 'throttle-debounce/debounce';
|
import debounce from 'throttle-debounce/debounce';
|
||||||
import { generateId, escapeRegexpString } from 'element-ui/src/utils/util';
|
import { generateId, escapeRegexpString, isIE, isEdge } from 'element-ui/src/utils/util';
|
||||||
|
|
||||||
const popperMixin = {
|
const popperMixin = {
|
||||||
props: {
|
props: {
|
||||||
|
@ -223,8 +223,7 @@ export default {
|
||||||
return this.disabled || (this.elForm || {}).disabled;
|
return this.disabled || (this.elForm || {}).disabled;
|
||||||
},
|
},
|
||||||
readonly() {
|
readonly() {
|
||||||
const isIE = !this.$isServer && !isNaN(Number(document.documentMode));
|
return !this.filterable || (!isIE() && !isEdge() && !this.menuVisible);
|
||||||
return !this.filterable || (!isIE && !this.menuVisible);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -147,7 +147,7 @@
|
||||||
import { t } from 'element-ui/src/locale';
|
import { t } from 'element-ui/src/locale';
|
||||||
import scrollIntoView from 'element-ui/src/utils/scroll-into-view';
|
import scrollIntoView from 'element-ui/src/utils/scroll-into-view';
|
||||||
import { getValueByPath } from 'element-ui/src/utils/util';
|
import { getValueByPath } from 'element-ui/src/utils/util';
|
||||||
import { valueEquals } from 'element-ui/src/utils/util';
|
import { valueEquals, isIE, isEdge } from 'element-ui/src/utils/util';
|
||||||
import NavigationMixin from './navigation-mixin';
|
import NavigationMixin from './navigation-mixin';
|
||||||
import { isKorean } from 'element-ui/src/utils/shared';
|
import { isKorean } from 'element-ui/src/utils/shared';
|
||||||
|
|
||||||
|
@ -180,9 +180,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
readonly() {
|
readonly() {
|
||||||
// trade-off for IE input readonly problem: https://github.com/ElemeFE/element/issues/10403
|
return !this.filterable || this.multiple || (!isIE() && !isEdge() && !this.visible);
|
||||||
const isIE = !this.$isServer && !isNaN(Number(document.documentMode));
|
|
||||||
return !this.filterable || this.multiple || !isIE && !this.visible;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
showClose() {
|
showClose() {
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import Vue from 'vue';
|
||||||
|
|
||||||
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||||
|
|
||||||
export function noop() {};
|
export function noop() {};
|
||||||
|
@ -110,3 +112,11 @@ export const coerceTruthyValueToArray = function(val) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const isIE = function() {
|
||||||
|
return !Vue.prototype.$isServer && !isNaN(Number(document.documentMode));
|
||||||
|
};
|
||||||
|
|
||||||
|
export const isEdge = function() {
|
||||||
|
return !Vue.prototype.$isServer && navigator.userAgent.indexOf('Edge') > -1;
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in New Issue