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

[Bug Report] van-stepper 输入框在 IOS 低版本无法聚焦输入 #13311

Closed
S-idong opened this issue Jan 15, 2025 · 6 comments
Closed

[Bug Report] van-stepper 输入框在 IOS 低版本无法聚焦输入 #13311

S-idong opened this issue Jan 15, 2025 · 6 comments

Comments

@S-idong
Copy link

S-idong commented Jan 15, 2025

重现链接

https://vant-ui.github.io/vant/#/zh-CN/stepper

Vant 版本

4.9.9

描述一下你遇到的问题。

van-stepper 如果配置了 min 和 max,但是用的是 :min="0" 或 :max="10" 的数字形式,低版本 IOS 将无法聚焦输入。我的设备是iPad Mini 4 ,版本为 15.8.3。

min和max修改回字符串形式,则不会重现 min="0", max="10"

重现步骤

点击输入框,成功弹出键盘,但是没有聚焦,无法输入

设备/浏览器

safari

@inottn
Copy link
Collaborator

inottn commented Jan 15, 2025

用文档地址可以复现吗

@S-idong
Copy link
Author

S-idong commented Jan 15, 2025

用文档地址可以复现吗

不能,重现链接我偷了个懒,文档用的是字符串传参,是没问题的。

@inottn
Copy link
Collaborator

inottn commented Jan 15, 2025

文档预览区实际上用的是 :min="5",参考https://github.com/youzan/vant/blob/main/packages/vant/src/stepper/demo/index.vue#L68-L72

@S-idong
Copy link
Author

S-idong commented Jan 15, 2025

文档预览区实际上用的是 :min="5",参考https://github.com/youzan/vant/blob/main/packages/vant/src/stepper/demo/index.vue#L68-L72

测试了一下,发现不是字符串和数字传参原因,而是项目打包后挂载才能重现。但除了低版本 IOS 设备,其他都没问题;
写了个 DEMO 也无法复现,抱歉,

@inottn
Copy link
Collaborator

inottn commented Jan 15, 2025

你可以在合适的时机或者定时器轮询打印 document.activeElement 看下能否排查出问题。

@S-idong
Copy link
Author

S-idong commented Jan 16, 2025

你可以在合适的时机或者定时器轮询打印 document.activeElement 看下能否排查出问题。

搞定了,加入以下css就解决了
:deep(.van-stepper__input) { user-select: text; -webkit-user-select: text; }

@inottn inottn closed this as completed Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants