Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions packages/cascader/src/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ import emitter from 'element-ui/src/mixins/emitter';
import Locale from 'element-ui/src/mixins/locale';
import { t } from 'element-ui/src/locale';
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 = {
props: {
Expand Down Expand Up @@ -223,8 +223,7 @@ export default {
return this.disabled || (this.elForm || {}).disabled;
},
readonly() {
const isIE = !this.$isServer && !isNaN(Number(document.documentMode));
return !this.filterable || (!isIE && !this.menuVisible);
return !this.filterable || (!isIE() && !isEdge() && !this.menuVisible);
}
},

Expand Down
6 changes: 2 additions & 4 deletions packages/select/src/select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
import { t } from 'element-ui/src/locale';
import scrollIntoView from 'element-ui/src/utils/scroll-into-view';
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 { isKorean } from 'element-ui/src/utils/shared';

Expand Down Expand Up @@ -180,9 +180,7 @@
},

readonly() {
// trade-off for IE input readonly problem: https://github.com/ElemeFE/element/issues/10403
const isIE = !this.$isServer && !isNaN(Number(document.documentMode));
return !this.filterable || this.multiple || !isIE && !this.visible;
return !this.filterable || this.multiple || (!isIE() && !isEdge() && !this.visible);
},

showClose() {
Expand Down
10 changes: 10 additions & 0 deletions src/utils/util.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Vue from 'vue';

const hasOwnProperty = Object.prototype.hasOwnProperty;

export function noop() {};
Expand Down Expand Up @@ -110,3 +112,11 @@ export const coerceTruthyValueToArray = function(val) {
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;
};