yjose / reactjs-popup

React Popup Component - Modals,Tooltips and Menus —  All in one
https://react-popup.elazizi.com/
MIT License
1.8k stars 207 forks source link

'open' prop does not control modal #338

Open PatrickKing opened 1 year ago

PatrickKing commented 1 year ago

When using a reactjs-popup modal in a simple use case, the 'open' prop doesn't control the modal. Clicking on the modal backdrop will cause the modal to close.

      <Popup modal open = { true }>
        <span> Modal content </span>
      </Popup>

This seems like I may have missed something. Or perhaps Popup isn't a really controlled component?

Version

2.0.5

Test Case

      <Popup modal open = { true }>
        <span> Modal content </span>
      </Popup>

Expected Behavior

When clicking on the backdrop, the popup honours the value of the 'open' prop and remains open.

Actual Behavior

The popup closes, ignoring the value of the 'open' prop.