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

InputItem 手动触发blur #788

Closed
jsers opened this issue Feb 8, 2017 · 6 comments
Closed

InputItem 手动触发blur #788

jsers opened this issue Feb 8, 2017 · 6 comments

Comments

@jsers
Copy link

jsers commented Feb 8, 2017

本地环境

  • antd-mobile 版本:0.9.14
  • 浏览器 (或标明是 react-native) 及其版本:[email protected]
  • 运行环境及其版本:IOS 10.2

问题描述

我希望外部手动触发 InputItem 的blur来关闭虚拟键盘,看目前貌似没办法实现。
可否让InputItem本身支持,或是把TextInput暴露出来

@warmhug
Copy link
Contributor

warmhug commented Feb 8, 2017

通过 ref 获取到 input 元素

@jsers
Copy link
Author

jsers commented Feb 8, 2017

@warmhug
通过ref只能取到 InputItem,然而对 InputItem.blur() 就报错了,InputItem并没有挂载这个方法
image

@warmhug
Copy link
Contributor

warmhug commented Feb 9, 2017

抱歉 0.9 没加 ref ,我加一下

@pengshaosu
Copy link

@warmhug
通过ref只能取到 InputItem,然而对 InputItem.blur() 就报错了,InputItem并没有挂载这个方法
image

@jsers
你通过这种方式实现了关闭虚拟键盘了吗?
多谢

@youngList
Copy link

所以说blur()到底是能不能用?通过ref没能找到input呀。。

@youngList
Copy link

现在出现了blur()调用成功(在onBlur事件里边有执行),但是焦点没有消失,antd-mobile: 2.2.9

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

No branches or pull requests

4 participants