alexkatz / react-tiny-popover

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

The `containerStyle` prop value gets lost after first interaction with the component #132

Closed vdmrox-dev closed 3 years ago

vdmrox-dev commented 3 years ago

I've been using version 6.0.2. In a container that I need to add a z-index and some other css properties, all of them get lost after the first interaction (click to open) with the component. Please check this example https://codesandbox.io/s/cocky-morse-bo2dk, and inspect the popover content at the first interaction when it shows up, and then at the second interaction, when it shows up again.

In the example, I have set containerStyle={{ zIndex: 1, overflow: "visible" }}. At the second interaction, the div's style attribute is modified, and the z-index and overflow properties are not there anymore. So, initially, I get the popover content over the other elements on screen, as expected. From the second interaction on, it goes under the elements, since the z-index was removed somehow.

Expected behaviour: the style attribute value should remain the same.

alexkatz commented 3 years ago

This has been fixed as of 6.0.4. Thanks!