SteffeyDev / react-native-popover-view

A well-tested, adaptable, lightweight <Popover> component for react-native
MIT License
614 stars 92 forks source link

Fixed bug causing tooltips to display off screen #100

Closed tecno40 closed 3 years ago

tecno40 commented 3 years ago

When using PopoverMode.TOOLTIP mode the view is displayed offscreen as the getDisplayAreaOffset() callback is referencing a view which appears off screen (leading the displayArea to also be off screen). This PR fixed the issue by moving the referenced View back onto the screen.

This PR may fix Issues #92

SteffeyDev commented 3 years ago

Thanks for pointing this out. I decided to take the fix a step further, by changing styles.container to not contain the fix shift and instead applying it only when needed. The end result should be the same.