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

I got a problem when i use Popup #1583

Closed
cielu opened this issue Jul 21, 2017 · 6 comments
Closed

I got a problem when i use Popup #1583

cielu opened this issue Jul 21, 2017 · 6 comments

Comments

@cielu
Copy link

cielu commented Jul 21, 2017

Version

1.4.2

Environment

react-native@0.44.3

Reproduction link

https://github.com/ant-design/ant-design-mobile/

Steps to reproduce

touch a button , and fire Popup.show() funtion

What is expected?

  1. Set maskClosable = true , and click mask could hide the popup
    2.when state changed , the component in Popup could refresh

What is actually happening?

1.set maskClosable et true , then click the mask , but the Popup could'n hide .
2.When state changed , the component in Popup didn't refresh , but if I hide the popup then show it , the component refreshed


第一个是我点蒙层的时候弹出层不能隐藏。。。
第二个是我需要在弹出层组件里做一个判断,根据state的值来展示不通的components, 但是 一旦 popup show了,里面的组件是不会被改变的,只有等hide之后再重新show才会显示。。。不知道有没有方法可以让popup在每次state值被改变之后都渲染一次。。。就像render一样

@paranoidjk
Copy link
Contributor

第一个是我点蒙层的时候弹出层不能隐藏。。。

官方 Demo 都是没问题的,请检查你的代码,给出可复现的 demo。https://github.com/ant-design/ant-design-mobile/blob/master/components/popup/demo/basic.tsx#L52

第二个是我需要在弹出层组件里做一个判断,根据state的值来展示不通的components, 但是 一旦 popup show了,里面的组件是不会被改变的,只有等hide之后再重新show才会显示。。。不知道有没有方法可以让popup在每次state值被改变之后都渲染一次。。。就像render一样

已知问题,目前的解决方案是你使用 PopupContainer, 未来的解决方案请关注 #1125

@cielu
Copy link
Author

cielu commented Jul 21, 2017

@paranoidjk 这个popupcontainer怎么用的,不是popup.show里面用吧?
我把它作为组件隔离出来也不行。。。
未来解决方案现在好像用不了啊。。

@paranoidjk
Copy link
Contributor

@cielu 就像官方的 Popup 一样,https://github.com/ant-design/ant-design-mobile/blob/97c45b1fa06c14ca137e64753f1997bbea6e7d5e/components/popup/index.tsx#L3, 意思是你基于我们的 PopupContainer 实现一个带有你业务逻辑的你私人版本的 Popup

@cielu
Copy link
Author

cielu commented Jul 21, 2017

哦哦,我试试,多谢

@cielu
Copy link
Author

cielu commented Jul 21, 2017

@paranoidjk 太麻烦了,我还是直接用modal实现吧。。。
那个点击膜层不隐藏的问题,在我这确实存在我是这样调用的 Popup.show(,{
maskClosable: true,
animationType: 'slide-up',
onMaskClose: () =>{},
},)

@paranoidjk
Copy link
Contributor

@cielu 你的代码无法复选,我 review 了代码也没问题。

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

2 participants