From b627438ada4fd43b0e4fa1c90d04d486e43ed666 Mon Sep 17 00:00:00 2001 From: qiumaoyun Date: Thu, 21 Mar 2019 18:35:18 +0800 Subject: [PATCH 1/2] confirm components: fix fast click input cannot get beyboard instantly --- src/components/confirm/index.vue | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/components/confirm/index.vue b/src/components/confirm/index.vue index c87c4d06f..74aec0d61 100755 --- a/src/components/confirm/index.vue +++ b/src/components/confirm/index.vue @@ -120,11 +120,20 @@ export default { if (val) { if (this.showInput) { this.msg = '' - setTimeout(() => { + const str = navigator.userAgent.toLowerCase() + const isIOS = str.match(/cpu iphone os (.*?) like mac os/) + if(!isIOS || parseInt(isIOS[1])< 11){//非IOS系统及IOS版本小于11 + setTimeout(() => { + if (this.$refs.input) { + this.setInputFocus() + } + }, 300) + return + } else { if (this.$refs.input) { this.setInputFocus() } - }, 300) + } } this.$emit('on-show') // emit just after msg is cleared } From 5b4db5925a7c1252c4443e0fcca0e4758dcbcf14 Mon Sep 17 00:00:00 2001 From: qiumaoyun Date: Fri, 22 Mar 2019 17:12:50 +0800 Subject: [PATCH 2/2] confirm: fix fast click input cannot get beyboard instantly --- src/components/confirm/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/confirm/index.vue b/src/components/confirm/index.vue index 74aec0d61..40e99d2b1 100755 --- a/src/components/confirm/index.vue +++ b/src/components/confirm/index.vue @@ -122,7 +122,7 @@ export default { this.msg = '' const str = navigator.userAgent.toLowerCase() const isIOS = str.match(/cpu iphone os (.*?) like mac os/) - if(!isIOS || parseInt(isIOS[1])< 11){//非IOS系统及IOS版本小于11 + if (!isIOS || parseInt(isIOS[1]) < 11) { // 非IOS系统及IOS版本小于11 setTimeout(() => { if (this.$refs.input) { this.setInputFocus()