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

Rodal doesn't close #25

Closed
nikkiczx opened this issue Jul 22, 2017 · 8 comments
Closed

Rodal doesn't close #25

nikkiczx opened this issue Jul 22, 2017 · 8 comments

Comments

@nikkiczx
Copy link

nikkiczx commented Jul 22, 2017

The rodal doesn't no matter what I do. Even if I do click on the close button. A portion of my code is below. I've checked that when I click the close button, the state changes from true to false but the rodal doesn't close. How do I make it close?

Please help. Thanks!

<div className="col-xs-12 table-fonts table-row-hover" onClick={this.eventPage.bind(this,event._id)} style={{top: '50px'}} key={event._id}>
                              <Rodal visible={this.state.visible} animation="flip" onClose={this.hide.bind(this)}>
                                  <ShowEvent />
                              </Rodal>
</div>
@chenjiahan
Copy link
Owner

@nikkiczx Can you provide a minimal demo of the problem via https://jsfiddle.net or similar?

@nikkiczx
Copy link
Author

I can try. But how do I add Rodal to jsfiddle?

@chenjiahan
Copy link
Owner

Here is a demo in codesandbox.

@nikkiczx
Copy link
Author

Ok.. Can you try this and see if it works? https://codesandbox.io/s/mwNp69xK9

@chenjiahan
Copy link
Owner

@nikkiczx Can't find any changes, did you save your code?

@nikkiczx
Copy link
Author

Yikes.. Sorry. Just saved it.

@chenjiahan
Copy link
Owner

@nikkiczx You should put the rodal outside the button. If you put the rodal inside the button, the click event of button will be triggered when you click rodal.

<button onClick={this.editEvent.bind(this, event._id)} className="fa fa-pencil-square-o fa-lg zero-padding" style={{color: 'green', top: '15px'}}>Test</button>
<Rodal visible={this.state.visible} animation="flip" onClose={this.hide.bind(this)}>
    Test
</Rodal>

@nikkiczx
Copy link
Author

OMG.. Thank you! I don't know why I did it that way to begin with facepalm

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