Skip to content

Commit

Permalink
Prevent iOS from being readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
tylertrotter committed Jul 31, 2020
1 parent 5bb5a76 commit 3714b4b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/select/src/select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
import { addResizeListener, removeResizeListener } from 'element-ui/src/utils/resize-event';
import { t } from 'element-ui/src/locale';
import scrollIntoView from 'element-ui/src/utils/scroll-into-view';
import { getValueByPath, valueEquals, isIE, isEdge } from 'element-ui/src/utils/util';
import { getValueByPath, valueEquals, isIE, isEdge, isIOS } from 'element-ui/src/utils/util';
import NavigationMixin from './navigation-mixin';
import { isKorean } from 'element-ui/src/utils/shared';
Expand Down Expand Up @@ -196,7 +196,7 @@
},
readonly() {
return !this.filterable || this.multiple || (!isIE() && !isEdge() && !this.visible);
return !this.filterable || this.multiple || (!isIE() && !isEdge() && !isIOS() && this.visible);
},
showClose() {
Expand Down
5 changes: 5 additions & 0 deletions src/utils/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ export const isFirefox = function() {
return !Vue.prototype.$isServer && !!window.navigator.userAgent.match(/firefox/i);
};

export const isIOS = function() {
// https://stackoverflow.com/a/58064481/2836695
return !Vue.prototype.$isServer && (/iPad|iPhone|iPod/.test(navigator.platform) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1));
};

export const autoprefixer = function(style) {
if (typeof style !== 'object') return style;
const rules = ['transform', 'transition', 'animation'];
Expand Down

0 comments on commit 3714b4b

Please sign in to comment.