alexkatz / react-tiny-popover

A simple and highly customizable popover react higher order component with no other dependencies! Typescript friendly.
MIT License
454 stars 121 forks source link

Breaking change from 7.0.1 -> 7.1.0 - Nested Popovers and onClickOutside boundary calculation #173

Closed dajaffe closed 2 years ago

dajaffe commented 2 years ago

I just discovered a breaking change in this upgrade around how boundaries are calculated in regards to nested Popovers. I'm working on a sandboxed recreation, but our code is structured as:

RandomComponent:

<TinyPopover>
  <ListItem />
  <ListItem />
</TinyPopover>
ListItem:

<TinyPopover>
    <SubListItem />
    <SubListItem />
</TinyPopover>

This is to create a popover with sub-context menus. On 7.0.1, onClick handlers within SubListItem were handled appropriately as the onClickOutside was not being triggered. With 7.1.0, it seems how boundaries were calculated was changed, and now onClickOutside is being triggered when clicking on these sub items.

dajaffe commented 2 years ago

Appears to be a duplicate of https://github.com/alexkatz/react-tiny-popover/issues/171