Skip to content

Commit 9c6a341

Browse files
committed
improve MutationObserver bug detection for iOS 10
1 parent a4396b9 commit 9c6a341

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/util/env.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,19 @@ export const isIE9 = UA && UA.indexOf('msie 9.0') > 0
1818
export const isAndroid = UA && UA.indexOf('android') > 0
1919
export const isIos = UA && /(iphone|ipad|ipod|ios)/i.test(UA)
2020
export const iosVersionMatch = isIos && UA.match(/os ([\d_]+)/)
21-
export const iosVersion = iosVersionMatch && iosVersionMatch[1].split('_')
21+
export const iosVersion = iosVersionMatch && iosVersionMatch[1].split('_').map(Number)
2222

23-
// detecting iOS UIWebView by indexedDB
24-
export const hasMutationObserverBug = iosVersion && Number(iosVersion[0]) >= 9 && Number(iosVersion[1]) >= 3 && !window.indexedDB
23+
// MutationObserver is unreliable in iOS 9.3 UIWebView
24+
// detecting it by checking presence of IndexedDB
25+
// ref #3027
26+
const hasMutationObserverBug =
27+
iosVersion &&
28+
!window.indexedDB && (
29+
iosVersion[0] > 9 || (
30+
iosVersion[0] === 9 &&
31+
iosVersion[1] >= 3
32+
)
33+
)
2534

2635
let transitionProp
2736
let transitionEndEvent

0 commit comments

Comments
 (0)