You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 9, 2022. It is now read-only.
There is a weird behavior in ios 11.3.
From the second time I click the input element on,
the keyboard does not show up when i quickly click the input.
Only if i keep touching the input, the keyboard shows up.
+1. focus() is not working in onTouchEnd, only when the function call is immediately following a touch/click interaction.Adding click function to the element to invoke focus function just works fine. Or any better solution?
line 336 you there is a bug:
if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month' && targetElement.type !== 'email') {
I was running in to this issue on iOS 11.3 + iPad + Cordova + UIWebView + Fastclick 1.0.6.
This issue did not happen on iOS 9.3.5 + iPad + Cordova + UIWebView + Fastclick 1.0.6.
I was able to reproduce it by:
Opening a page with a datetime input and a text input
Tapping the datetime input, so it shows the selection popup
Tapping outside the popup to close the popup
Tap quickly on a text input
-> The text input is not focused and keyboard is not shown
Tap and keep pressing for a short while on the text input
-> The text input is focused and keyboard is shown
As @yylgit said, adding targetElement.focus(); before targetElement.setSelectionRange(length, length); fixes the issue. No idea why, but it apparently does.
Does anyone know if adding that focus() call breaks anything else?
Activity
tabtang commentedon Apr 8, 2018
I encountered it too. There seems to be a big problem on IOS 11.3, mainly on form elements.
InternetExplorer8 commentedon Apr 10, 2018
Any workarounds for this?
jzlingmo commentedon Apr 11, 2018
+1.
focus()
is not working inonTouchEnd
, only when the function call is immediately following a touch/click interaction.Adding click function to the element to invoke focus function just works fine. Or any better solution?tabtang commentedon Apr 11, 2018
There is a more serious problem. When "home" is pressed away from browser temporarily, all elements are clicked without response.
ronnievdc commentedon Apr 11, 2018
The people behind Framework7io could have found the reason and solution.
The commit that fixes the problem could be found here: framework7io/framework7@ac02ad1
tabtang commentedon Apr 12, 2018
@ronnievdc
According to the solution you have reissued, problem 2 has been solved.
But the bug of the form element has not been solved yet
slinhuang commentedon Apr 13, 2018
change the focus method,
FastClick.prototype.focus = function(targetElement) {
'use strict';
targetElement.focus();
};
vahvarh commentedon Apr 16, 2018
line 336 you there is a bug:
if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month' && targetElement.type !== 'email') {
should read
yylgit commentedon Apr 17, 2018
@tabtang

add targetElement.focus();
i use this method solve this problem
tabtang commentedon Apr 17, 2018
@yylgit 解决了,哥们!
yylgit commentedon Apr 17, 2018
@tabtang 怎么解决的姐们,是用我写的这种方法吗
ButchMonkey commentedon Apr 17, 2018
Text areas also seem to be affected
tabtang commentedon Apr 20, 2018
@yylgit 是用的你的方法!(我也是哥们)
tabtang commentedon Apr 20, 2018
我这里试了 textarea也没有问题了
maxcong commentedon Apr 27, 2018
楼上:yylgit 修改为正解,亲测可用
lasselaakkonen commentedon May 3, 2018
I was running in to this issue on iOS 11.3 + iPad + Cordova + UIWebView + Fastclick 1.0.6.
This issue did not happen on iOS 9.3.5 + iPad + Cordova + UIWebView + Fastclick 1.0.6.
I was able to reproduce it by:
-> The text input is not focused and keyboard is not shown
-> The text input is focused and keyboard is shown
As @yylgit said, adding
targetElement.focus();
beforetargetElement.setSelectionRange(length, length);
fixes the issue. No idea why, but it apparently does.Does anyone know if adding that
focus()
call breaks anything else?ftlabs#548 Fix focusing on form elements, when tapping fast.
Merge pull request #2 from lasselaakkonen/548-ios-clicks-on-inputs-fa…
prvinuch commentedon May 12, 2018
to me as well... targetElement.focus(); before targetElement.setSelectionRange(length, length); fixes the issue.
geraldlrh commentedon May 31, 2018
iOS11.3 fastclick.js 相关bug
这里有篇文章讲这个原因
xiruiZeng commentedon Jul 19, 2018
@yylgit 你好,我是11.4的系统,打包hbuilder打包APP之后在ios上input输入框不能轻触弹出键盘,而要在输入框上停留一段1秒左右才会弹出键盘,以上你们讨论的方法我试了些还是不行,请问可以指教一二吗?
xiruiZeng commentedon Jul 19, 2018
@lasselaakkonen 我加了这个targetElement.focus();还是没解决到,还是快速点击input不能弹出键盘
lilong7676 commentedon Apr 8, 2019
iOS11.3 + 都有这个问题,这种方式的确解决了,那是不是说明iOS11.3版本以后就不需要fastClick了?
Young5416 commentedon May 16, 2019
@yylgit 加上了textarea还是没效果
Young5416 commentedon May 16, 2019
@yylgit ios系统12.2
Young5416 commentedon May 16, 2019
@yylgit 解决了,是缓存原因
jungor commentedon Nov 25, 2019
为啥npm不发新版