admin管理员组文章数量:1317118
How can I disable the return key if the TextInput is empty.Like in default ios messenger
So if there is no text in the input the search button is disabled.
In react-native using returnKeyType="search"
the Search button es but I didn't find anything to disable it.
How will I achieve that??
How can I disable the return key if the TextInput is empty.Like in default ios messenger
So if there is no text in the input the search button is disabled.
In react-native using returnKeyType="search"
the Search button es but I didn't find anything to disable it.
How will I achieve that??
Share Improve this question asked May 2, 2019 at 14:16 priteshpritesh 2,19221 silver badges26 bronze badges2 Answers
Reset to default 8Use enablesReturnKeyAutomatically props of TextInput
I know it doesn't answer your question, but it helped me to do something like this, since you can't disable it fully...
You can disable blurOnSubmit
and handle input like this:
<TextInput
blurOnSubmit={false}
onSubmitEditing={(submitEvent) =>
doSomething(submitEvent.nativeEvent.text)
Keyboard.dismiss() // import { Keyboard } from 'react-native'
}
/>
(some useful tips on disabling return key found here)
本文标签: javascriptHow to disable return key in react nativeStack Overflow
版权声明:本文标题:javascript - How to disable return key in react native? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742022321a2414904.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论