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

Clicking on "openByClickOn" element causes portal to hide and then immediately show. #65

Closed
sam-aiq opened this issue Apr 15, 2016 · 6 comments

Comments

@sam-aiq
Copy link

sam-aiq commented Apr 15, 2016

When the prop closeOnOutsideClick is true, clicking on the openByClickOn element causes the portal to hide, and then immediately show.

@tajo
Copy link
Owner

tajo commented Apr 20, 2016

Yeah, that's a glitch. Do you want to create a PR? It should be simple.

@oldboyxx
Copy link

Replace mousedown events with mouseup.

@Sediug
Copy link
Contributor

Sediug commented May 1, 2016

That's an awesome component. It will be very useful for my projects. Thanks very much! @tajo

@tajo
Copy link
Owner

tajo commented May 2, 2016

fixed in v2.1.1

@tajo tajo closed this as completed May 2, 2016
@Hypnosphi
Copy link

Hypnosphi commented Nov 30, 2016

I have the same issue in 3.0.0. Replacing mousedown with mouseup looks insufficient as it's still triggered before click

Maybe you should check here that e.target isn't the openByClickOn element or its child
https://github.com/tajo/react-portal/blob/master/lib/portal.js#L111

UPD: I can visually detect this issue only if portal content has css animations

@Hypnosphi
Copy link

Hypnosphi commented Nov 30, 2016

And I guess that most people would like the portal to hide in this case, not to keep being shown (one can achieve this with beforeClose={(ev, cb) => setTimeout(cb, 0)} though)

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

5 participants