reactjs-popup
reactjs-popup copied to clipboard
Popup only repositions on window resize and not when content changes
Only repositioning on window resize is probably intended so this is more of a feature request I suppose.
Version
2.0.4
Test Case
Dropdown/popup that loads content (e.g. list of data) after opening will have incorrect position calculated and won't be repositioned once content is loaded. This causes popups to overflow bounds once content is displayed.
Workaround, trigger a dummy resize event once data is loaded (through useLayoutEffect
or useEffect
) that'll cause the popup to recalculate its position.
Expected Behavior
Popup opens -> Loading indicator while data is fetched/formatted -> Data is loaded and displayed -> Popup repositions if content overflows defined element in keepToolTipInside
.
Actual Behavior
Popup Opens -> Loading indicator while data is fetched/formatted -> Data is loaded and displayed -> Popup doesn't reposition and potentially overflows page.
Same problem, wondering if i should write my own popup instead of using the package.
Same problem. This problem would not exist if the developers of the library added the setPosition method to the arguments of the "children" function.
same problem on my end :) would be great if we could have this reposition available.