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

使用Modal.alert()时,message参数传一个长列表需要滚动的组件,滚动失效 #2477

Closed
1 task
huangming1994 opened this issue Apr 19, 2018 · 4 comments
Assignees

Comments

@huangming1994
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

2.1.8

Environment

ios

Reproduction link

https://github.com/ant-design/ant-design-mobile/blob/master/components/modal/alert.tsx

Steps to reproduce

  1. 使用Modal.alert()时,message参数传一个长列表需要滚动的组件
  2. 无法触发滚动

What is expected?

可以滚动

What is actually happening?

无法滚动

@ant-design-bot
Copy link

Translation of this issue:


When using Modal.alert(), the message parameter passes a long list of components that need to be scrolled

  • [] I have searched the issues of this repository and believe that this is not a duplicate.

Version

2.1.8

Environment

Ios

Reproduction link

[https://github.com/ant-design/ant-design-mobile/blob/master/components/modal/alert.tsx] (https://github.com/ant-design/ant-design-mobile/ Blob/master/components/modal/alert.tsx)

Steps to reproduce

  1. When using Modal.alert(), the message parameter passes a long list of components that need to be scrolled
  2. Cannot trigger scrolling

What is expected?

Can scroll

What is actually happening?

Can't scroll

@huangming1994
Copy link
Author

看了下,是modal.alert里阻止了touchmove,不过不是很明白下面这两段代码。
antd1
antd2

  1. touchmove触发的时候,modal.alert的结构target是am-modal-wrap,父级找上去永远匹配不到am-modal-footer,导致ios下都被preventDefault。

  2. 还有不是很明白为什么ios下找不到am-modal-footer的话,要阻止掉touchmove。

@huangming1994
Copy link
Author

huangming1994 commented Apr 21, 2018

暂时用npm scoped package替换antd-mobile,添加alias: { 'antd-mobile': '@username/antd-mobile' }。 babelrc中的按需加载libraryName字段无须修改。

@warmhug
Copy link
Contributor

warmhug commented May 11, 2018

Close for #2486

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