Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Keyboard not showing up on iOS when focus #545

Merged
merged 1 commit into from Sep 16, 2020
Merged

fix: Keyboard not showing up on iOS when focus #545

merged 1 commit into from Sep 16, 2020

Conversation

kerm1it
Copy link
Member

@kerm1it kerm1it commented Sep 15, 2020

close #26648

@afc163

发现是这次提交导致的问题:ed63549

我看你把 focus 从 onClick 挪到了 onMouseDown 中,这导致在 IOS 上无法正常聚焦调起键盘,我又放回在 onClick 中了,你看看有什么问题?

@vercel
Copy link

vercel bot commented Sep 15, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/react-component/select/c55a7zewm
✅ Preview: https://select-git-fix-26648.react-component.vercel.app

@kerm1it kerm1it requested a review from afc163 September 15, 2020 16:33
@codecov
Copy link

codecov bot commented Sep 15, 2020

Codecov Report

Merging #545 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #545   +/-   ##
=======================================
  Coverage   99.37%   99.37%           
=======================================
  Files          20       20           
  Lines         955      956    +1     
  Branches      321      320    -1     
=======================================
+ Hits          949      950    +1     
  Misses          5        5           
  Partials        1        1           
Impacted Files Coverage Δ
src/Selector/index.tsx 96.82% <100.00%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4e1e69d...c1defbd. Read the comment docs.

@afc163
Copy link
Member

afc163 commented Sep 16, 2020

测一下 IE11 的 onFocus。

@tkempken
Copy link

@kermit-xuan @afc163
Maybe it will help to add an additional touchstart event. In this case, IE11 and ios touch devices will be happy.

@kerm1it
Copy link
Member Author

kerm1it commented Sep 16, 2020

This is not work in IE 11.

touchstart is event for mobile decices. I don't know whether it will appear other problems.

I think we won't resolve problem, the reason is in ant-design/ant-design#26648 (comment)

@afc163 What do you think?

@afc163 afc163 merged commit e90b059 into master Sep 16, 2020
@afc163 afc163 deleted the fix-26648 branch September 16, 2020 06:18
@afc163
Copy link
Member

afc163 commented Sep 16, 2020

Using click event is a accepted way for both desktop and mobile devices.

@kerm1it
Copy link
Member Author

kerm1it commented Sep 16, 2020

I try this example in IE11. onFocus isn't called when click selector(not input element)

You can try it again in IE11.

@kerm1it kerm1it restored the fix-26648 branch September 16, 2020 06:40
@kerm1it kerm1it deleted the fix-26648 branch September 16, 2020 06:40
event.preventDefault();
}
const onClick = ({ target }) => {
if (target !== inputRef.current) {
// Should focus input if click the selector
const isIE = (document.body.style as any).msTouchAction !== undefined;
if (isIE) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我在 IE11 下测试,不加这个 hack,IE 也能触发了。

也就是说完全回到 #513 修改前的状态也能触发 focus 了,见鬼。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

先这样吧,遇到反馈再说。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Select/TreeSelect: Keyboard not showing up on iOS after a value is set
3 participants