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

When closeOnDocumentClick is specified, popup will not be closed by tap operation. #288

Open
uk-taniyama opened this issue Dec 11, 2021 · 1 comment

Comments

@uk-taniyama
Copy link

Version

2.0.5

Test Case

https://codesandbox.io/embed/reactjs-popup-issue-template-forked-qt0wv

Android Chrome or Simulate mobile devices with Device Mode - Chrome

Expected Behavior

  1. Tap the button. then open [popup content].
  2. Tap outside of [popup content]. then close [popup content].

Actual Behavior

  1. Tap the button. then open [popup content].
  2. Tap outside of [popup content]. then close [popup content].

However, the [popup content] opens immediately.

uk-taniyama pushed a commit to uk-taniyama/reactjs-popup that referenced this issue Dec 11, 2021
@benomatis
Copy link
Contributor

Your open state is set to true by default. Set it to false and it will not open immediately, only on button click.

const [open, setOpen] = useState(false);
//                               ^^^^^ This was set to 'true' before

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