Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Popover: smoothly reposition on scroll #18813
This PR refactors the
The only way we can fix this is by avoiding setting state. Instead, we should update the DOM immediately. This is also more performant. There's no way around the DOM, unfortunately.
As a result, I think the component has also become simpler. There's no need for the many nested hooks and passing around props. I also swapped out the
How has this been tested?
Open some popovers and play with scrolling and resizing. Nothing else should be different from
Types of changes
Are you sure you couldn't just use
I just checked, and yep, the "Gutenberg Test Plugin, Disables the CSS animations" was enabled. I never enabled it. Is it supposed to be enabled by default when you create a dev environment? (I'm using the
Anyway, it looks like there are no issues (that I know of) on this branch after all.
This is working well for me. I was hoping it would fix the issue where sometimes the scrollbar in popovers don't appear (you can trigger it inconsistently in the More menu or the block settings menu) but unfortunately, it doesn't, it still happens sometimes. I was curious whether you have an idea why this happens sometimes.
I see what you mean. Looks like a bug somewhere else in the code, but I'll have a look.
* wip * wip2 * simplify * fix focus issue * Adjust snapshots * Fix CSS * Adjust more CSS * Fix is-mobile issue and restore IsolatedEventContainer * Add useEffect dependencies * Address feedback * Fix content size calc * Unset content width/height if none is provided