From e7b8f6741e31f8d4c6d2329e86977b1897abf566 Mon Sep 17 00:00:00 2001 From: neverland Date: Fri, 7 Dec 2018 16:11:34 +0800 Subject: [PATCH] [bugfix] Popup: can not hide in iOS 8 (#1029) --- packages/mixins/transition.ts | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/packages/mixins/transition.ts b/packages/mixins/transition.ts index da4eae28..a3845734 100644 --- a/packages/mixins/transition.ts +++ b/packages/mixins/transition.ts @@ -16,23 +16,38 @@ export const transition = function(showDefaultValue) { data: { type: '', inited: false, - display: false + display: false, + supportAnimation: true }, attached() { if (this.data.show) { this.show(); } + + this.detectSupport(); }, methods: { + detectSupport() { + wx.getSystemInfo({ + success: info => { + if (info && info.system && info.system.indexOf('iOS 8') === 0) { + this.set({ supportAnimation: false }); + } + } + }); + }, + observeShow(value) { if (value) { this.show(); } else { - this.set({ - type: 'leave' - }); + if (this.data.supportAnimation) { + this.set({ type: 'leave' }); + } else { + this.set({ display: false }); + } } },