reactjs-popup
reactjs-popup copied to clipboard
When closeOnDocumentClick is specified, popup will not be closed by tap operation.
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
- Tap the button. then open [popup content].
- Tap outside of [popup content]. then close [popup content].
Actual Behavior
- Tap the button. then open [popup content].
- Tap outside of [popup content]. then close [popup content].
However, the [popup content] opens immediately.
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