ant-design-mobile
ant-design-mobile copied to clipboard
[SearchBar] iOS11 搜索按钮文本不是搜索
Version of antd-mobile
latest
Operating system and its version
iOS
Browser and its version
iOS11.4
Sandbox to reproduce
No response
What happened?
最基础用法
<SearchBar />
修复方案
<form action="#">
<SearchBar />
</form>
我觉得 SearchBar 需要一个内置的 form 包裹它,而不是用户去提供 form
Relevant log output
No response
如果增加 form 标签,可能出现 form 嵌套的情况
<Form>
<SearchBar/>
</Form>
上面这种情况就会控制台报错
诶这个问题是只有 iOS 11 上存在么
手头只有 iOS11.4 的模拟器,较老的浏览器应该都会有这种情况吧,网络上搜索相关的内容,也只有 iOS 相关的讨论 https://caniuse.com/?search=enterkeyhint
目前我也只找到这个办法,如果用 enterkeyhinit
,只能解决部分安卓和苹果机型的问题
https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/Input/search#incremental
看起来 iOS 13.4 以上就不会出现这个问题了,要不这个问题我们加到 FAQ 里,然后就不修复了?(等待时间⏳慢慢消化)毕竟对用户来说影响也不是特别大