diff --git a/components/_util/env.js b/components/_util/env.js index b4d3769a7..96894fc58 100644 --- a/components/_util/env.js +++ b/components/_util/env.js @@ -6,8 +6,8 @@ export const UA = inBrowser && window.navigator.userAgent.toLowerCase(); export const isIE = UA && /msie|trident/.test(UA); export const isIE9 = UA && UA.indexOf('msie 9.0') > 0; export const isEdge = UA && UA.indexOf('edge/') > 0; -export const isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android'); -export const isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios'); +export const isAndroid = (UA && UA.indexOf('android') > 0) || weexPlatform === 'android'; +export const isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || weexPlatform === 'ios'; export const isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge; export const isPhantomJS = UA && /phantomjs/.test(UA); export const isFF = UA && UA.match(/firefox\/(\d+)/); diff --git a/components/vc-select/Select.jsx b/components/vc-select/Select.jsx index 5e84c1eff..028f79ebf 100644 --- a/components/vc-select/Select.jsx +++ b/components/vc-select/Select.jsx @@ -51,6 +51,7 @@ import { } from './util'; import { SelectPropTypes } from './PropTypes'; import contains from '../_util/Dom/contains'; +import { isIE, isEdge } from '../_util/env'; Vue.use(ref, { name: 'ant-ref' }); const SELECT_EMPTY_VALUE_KEY = 'RC_SELECT_EMPTY_VALUE_KEY'; @@ -623,13 +624,17 @@ const Select = { }, inputBlur(e) { const target = e.relatedTarget || document.activeElement; + + // https://github.com/vueComponent/ant-design-vue/issues/999 + // https://github.com/vueComponent/ant-design-vue/issues/1223 if ( - e.relatedTarget === this.$refs.arrow || - (target && - this.selectTriggerRef && - this.selectTriggerRef.getInnerMenu() && - this.selectTriggerRef.getInnerMenu().$el === target) || - contains(e.target, target) + (isIE || isEdge) && + (e.relatedTarget === this.$refs.arrow || + (target && + this.selectTriggerRef && + this.selectTriggerRef.getInnerMenu() && + this.selectTriggerRef.getInnerMenu().$el === target) || + contains(e.target, target)) ) { e.target.focus(); e.preventDefault();