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

React Native的TouchableOpacity组件中嵌套antd-mobile的View点击问题 #769

Closed
liubin1023 opened this issue Jan 24, 2017 · 12 comments
Closed
Assignees

Comments

@liubin1023
Copy link

本地环境

  • antd-mobile 版本:1.0.0-alpha.33
  • 浏览器 (或标明是 react-native) 及其版本:0.39.2
  • 运行环境及其版本:mac

你做了什么?

React Native的TouchableOpacity组件中嵌套antd-mobile的View

你期待的结果是:

可以正常点击

实际上的结果:

View区域中的内容无法点击,View之外TouchableOpacity之中的内容可以点击

可重现的在线演示

@liubin1023
Copy link
Author

如果把View组件换成Text组件就没有嵌套无法点击的问题

@warmhug warmhug added the RN label Jan 25, 2017
@silentcloud
Copy link
Contributor

View 用的 RN 官方的,理论上应该没问题

@liubin1023
Copy link
Author

image

@silentcloud
Copy link
Contributor

silentcloud commented Feb 4, 2017

@liubin1023 Flex.Item 组件已经用 TouchableWithoutFeedback 包裹了, https://github.com/ant-design/ant-design-mobile/blob/master/components/flex/FlexItem.tsx#L15

@pingan1927 Flex Item 不应该内置 touchable, 应该交由用户自己套用 touch

@liubin1023
Copy link
Author

@silentcloud 如果增加长按事件怎么办?

@silentcloud
Copy link
Contributor

@liubin1023 要改造 FlexItem 这个组件

@liubin1023
Copy link
Author

@silentcloud 这个要等1.0发布吗,大概几号发布?

@silentcloud
Copy link
Contributor

@liubin1023 正式版 20号发布,如果你等不及,我可以先发个 alpha

@liubin1023
Copy link
Author

@silentcloud 十分感谢

@warmhug
Copy link
Contributor

warmhug commented Feb 7, 2017

这样修改可能引起其他使用 flex 的组件问题、比如 #756 @silentcloud 要 review 下所有用 flex 的其他组件

@silentcloud
Copy link
Contributor

@liubin1023 @warmhug 还是先暂时改成内置,不然有些组件不好处理(比如 Grid 单个 Item 不能实现满点击),现在改成内置的 touchableWithoutFeedback 支持更多原生 prop

@liubin1023
Copy link
Author

@silentcloud
image
无点击效果
方法无触发

image

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