【发布时间】:2020-08-10 05:41:35
【问题描述】:
我正在尝试创建一个既可编辑又具有可点击 url 的 TextInput 组件。根据 react native docs,只有在 editable={false} 时才支持 dataDetectorTypes 属性。
Determines the types of data converted to clickable URLs in the text input. Only valid if multiline={true} and editable={false}.
有没有人找到解决这个限制的方法?似乎应该是可能的。我想要的行为是……
- 点击 url 应该在浏览器中打开它
- 点击其他任何位置应在该位置开始编辑
- TextInput当前有焦点时,如果链接不再可点击也没关系
【问题讨论】:
-
只需将链接放在 TextInput 下方
标签: react-native textinput datadetectortypes