@@ -25,6 +25,10 @@ const ALL_HANDLERS = ['onClick', 'onMouseDown', 'onTouchStart', 'onMouseEnter',
25
25
26
26
const IS_REACT_16 = ! ! createPortal ;
27
27
28
+ const isMobile = typeof navigator !== 'undefined' && ! ! navigator . userAgent . match (
29
+ / ( A n d r o i d | i P h o n e | i P a d | i P o d | i O S | U C W E B ) / i
30
+ ) ;
31
+
28
32
const mixins = [ ] ;
29
33
30
34
if ( ! IS_REACT_16 ) {
@@ -163,7 +167,7 @@ const Trigger = createReactClass({
163
167
triggerAfterPopupVisibleChange ( ) ;
164
168
}
165
169
166
- // We must listen to `mousedown` or `touchstart` , edge case:
170
+ // We must listen to `mousedown`, edge case:
167
171
// https://github.com/ant-design/ant-design/issues/5804
168
172
// https://github.com/react-component/calendar/issues/250
169
173
// https://github.com/react-component/trigger/issues/50
@@ -175,10 +179,13 @@ const Trigger = createReactClass({
175
179
'mousedown' , this . onDocumentClick ) ;
176
180
}
177
181
// always hide on mobile
178
- if ( ! this . touchOutsideHandler ) {
182
+ // `isMobile` fix: mask clicked will cause below element events triggered
183
+ // https://github.com/ant-design/ant-design-mobile/issues/1909
184
+ // https://github.com/ant-design/ant-design-mobile/issues/1928
185
+ if ( ! this . touchOutsideHandler && isMobile ) {
179
186
currentDocument = currentDocument || props . getDocument ( ) ;
180
187
this . touchOutsideHandler = addEventListener ( currentDocument ,
181
- 'touchstart ' , this . onDocumentClick ) ;
188
+ 'click ' , this . onDocumentClick ) ;
182
189
}
183
190
return ;
184
191
}
0 commit comments