fix: ie select open bug #1223
parent
f58cea1dff
commit
48fda08795
|
@ -1,4 +1,13 @@
|
|||
// Browser environment sniffing
|
||||
export const inBrowser = typeof window !== 'undefined';
|
||||
export const inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
|
||||
export const weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
|
||||
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 isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
|
||||
export const isPhantomJS = UA && /phantomjs/.test(UA);
|
||||
export const isFF = UA && UA.match(/firefox\/(\d+)/);
|
||||
|
|
|
@ -449,6 +449,7 @@ const Select = {
|
|||
onArrowClick(e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
this.clearBlurTime();
|
||||
if (!this.disabled) {
|
||||
this.setOpenState(!this.$data._open, !this.$data._open);
|
||||
}
|
||||
|
@ -623,6 +624,7 @@ const Select = {
|
|||
inputBlur(e) {
|
||||
const target = e.relatedTarget || document.activeElement;
|
||||
if (
|
||||
e.relatedTarget === this.$refs.arrow ||
|
||||
(target &&
|
||||
this.selectTriggerRef &&
|
||||
this.selectTriggerRef.getInnerMenu() &&
|
||||
|
@ -685,7 +687,7 @@ const Select = {
|
|||
}
|
||||
this.setOpenState(false);
|
||||
this.$emit('blur', this.getVLForOnChange(value));
|
||||
}, 10);
|
||||
}, 200);
|
||||
},
|
||||
inputFocus(e) {
|
||||
if (this.$props.disabled) {
|
||||
|
@ -1412,6 +1414,7 @@ const Select = {
|
|||
style={UNSELECTABLE_STYLE}
|
||||
{...{ attrs: UNSELECTABLE_ATTRIBUTE }}
|
||||
onClick={this.onArrowClick}
|
||||
ref="arrow"
|
||||
>
|
||||
{inputIcon || defaultIcon}
|
||||
</span>
|
||||
|
|
|
@ -237,7 +237,7 @@ export default {
|
|||
},
|
||||
|
||||
onBlur(e) {
|
||||
if (!contains(e.target, e.relatedTarget)) {
|
||||
if (!contains(e.target, e.relatedTarget || document.activeElement)) {
|
||||
this.fireEvents('blur', e);
|
||||
this.clearDelayTimer();
|
||||
if (this.isBlurToHide()) {
|
||||
|
|
Loading…
Reference in New Issue