Closed felixfeng33 closed 1 month ago
This issue is because of wrapping the floating toolbar in <PortalBody />
it moves the element which is passed to @floating-ui
's setFloatingRef
outside of the scroll hierarchy:
The simple fix for me was to not use <PortalBody />
. If you do portal the item into the body then it will also lag behind when you scroll instead of scroll smoothly with your content. This is because onScroll
does not trigger at the same rate the page actually scrolls and the updates are slow. Removing <PortalBody />
also fixes this because the element is scrolled with its container smoothly by the browser before @floating-ui
's updates its position.
Fixed by removing PortalBody
Description
If the editor has a fixed height, the floating toolbar will be strange.
https://github.com/udecode/plate/assets/164472012/bc5b2c04-9bbd-472d-aa78-9717d15ebfa9
Steps to Reproduce
Sandbox
Expected Behavior
Environment
Bounty
Click here to add a bounty via Algora.
Funding