reactjs-popup icon indicating copy to clipboard operation
reactjs-popup copied to clipboard

Popup only repositions on window resize and not when content changes

Open kollin-francis opened this issue 3 years ago • 3 comments

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.

kollin-francis avatar Jul 20 '21 17:07 kollin-francis

Same problem, wondering if i should write my own popup instead of using the package.

flazouh avatar May 07 '23 14:05 flazouh

Same problem. This problem would not exist if the developers of the library added the setPosition method to the arguments of the "children" function.

SviatoslavMJS avatar Dec 04 '23 08:12 SviatoslavMJS

same problem on my end :) would be great if we could have this reposition available.

vrinceanuv avatar Feb 07 '24 09:02 vrinceanuv