File tree 3 files changed +14
-2
lines changed
3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change
1
+ // Browser environment sniffing
1
2
export const inBrowser = typeof window !== 'undefined' ;
3
+ export const inWeex = typeof WXEnvironment !== 'undefined' && ! ! WXEnvironment . platform ;
4
+ export const weexPlatform = inWeex && WXEnvironment . platform . toLowerCase ( ) ;
2
5
export const UA = inBrowser && window . navigator . userAgent . toLowerCase ( ) ;
3
6
export const isIE = UA && / m s i e | t r i d e n t / . test ( UA ) ;
4
7
export const isIE9 = UA && UA . indexOf ( 'msie 9.0' ) > 0 ;
8
+ export const isEdge = UA && UA . indexOf ( 'edge/' ) > 0 ;
9
+ export const isAndroid = ( UA && UA . indexOf ( 'android' ) > 0 ) || ( weexPlatform === 'android' ) ;
10
+ export const isIOS = ( UA && / i p h o n e | i p a d | i p o d | i o s / . test ( UA ) ) || ( weexPlatform === 'ios' ) ;
11
+ export const isChrome = UA && / c h r o m e \/ \d + / . test ( UA ) && ! isEdge ;
12
+ export const isPhantomJS = UA && / p h a n t o m j s / . test ( UA ) ;
13
+ export const isFF = UA && UA . match ( / f i r e f o x \/ ( \d + ) / ) ;
Original file line number Diff line number Diff line change @@ -449,6 +449,7 @@ const Select = {
449
449
onArrowClick ( e ) {
450
450
e . stopPropagation ( ) ;
451
451
e . preventDefault ( ) ;
452
+ this . clearBlurTime ( ) ;
452
453
if ( ! this . disabled ) {
453
454
this . setOpenState ( ! this . $data . _open , ! this . $data . _open ) ;
454
455
}
@@ -623,6 +624,7 @@ const Select = {
623
624
inputBlur ( e ) {
624
625
const target = e . relatedTarget || document . activeElement ;
625
626
if (
627
+ e . relatedTarget === this . $refs . arrow ||
626
628
( target &&
627
629
this . selectTriggerRef &&
628
630
this . selectTriggerRef . getInnerMenu ( ) &&
@@ -685,7 +687,7 @@ const Select = {
685
687
}
686
688
this . setOpenState ( false ) ;
687
689
this . $emit ( 'blur' , this . getVLForOnChange ( value ) ) ;
688
- } , 10 ) ;
690
+ } , 200 ) ;
689
691
} ,
690
692
inputFocus ( e ) {
691
693
if ( this . $props . disabled ) {
@@ -1412,6 +1414,7 @@ const Select = {
1412
1414
style = { UNSELECTABLE_STYLE }
1413
1415
{ ...{ attrs : UNSELECTABLE_ATTRIBUTE } }
1414
1416
onClick = { this . onArrowClick }
1417
+ ref = "arrow"
1415
1418
>
1416
1419
{ inputIcon || defaultIcon }
1417
1420
</ span >
Original file line number Diff line number Diff line change @@ -237,7 +237,7 @@ export default {
237
237
} ,
238
238
239
239
onBlur ( e ) {
240
- if ( ! contains ( e . target , e . relatedTarget ) ) {
240
+ if ( ! contains ( e . target , e . relatedTarget || document . activeElement ) ) {
241
241
this . fireEvents ( 'blur' , e ) ;
242
242
this . clearDelayTimer ( ) ;
243
243
if ( this . isBlurToHide ( ) ) {
You can’t perform that action at this time.
0 commit comments