反应本机自定义自动完成onblur fires在OnPress之前

发布于 2025-01-25 13:57:53 字数 236 浏览 5 评论 0原文

我有一个textInput具有列表itoment的组件,该组件显示下面的搜索建议列表,类似于自动完成。问题是当我单击列表中的建议之一时,它首先触发onblur textInput的方法,然后需要第二次按发射OnPress方法。如何一次点击调用OnPress方法?如果我按下下拉列表项目,我不希望它模糊。

I have a TextInput component with a List Item component that displays a list of search suggestions below it, similar to an AutoComplete. The issue is when I click one of the suggestions from the list it first fires the onBlur method of the TextInput and requires a second press before it fires the onPress method. How do I call the onPress method in one tap? I don't want it to blur if I'm pressing a dropdown list item.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

滥情空心 2025-02-01 13:57:53

页。

键盘插入式图添加到flatlistProps中。

flatListProps={{
  keyboardShouldPersistTaps: 'handled'
}}

A solution to this has been provided on the library's issues page.

Add the keyboardShouldPersistTaps prop to flatListProps.

flatListProps={{
  keyboardShouldPersistTaps: 'handled'
}}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文