Repository navigation
Closed
Labels
[Package] Components/packages/components[Type] EnhancementA suggestion for improvement.[Type] Tracking IssueTactical breakdown of efforts across the codebase and/or tied to Overview issues.
Description
The recent refactor of the Popover component to use floating ui has caused a few regressions, and still feels partially incomplete.
Known regressions (either issues, or PRs containing a fix):
- Fix customizer block toolbar after popover refactor #41312
-
CustomGradientPicker:ColorPickerpopover is glitchy (size and position) #41353 - Unable to select colors on small screens #41894
- Tooltip: Fix positioning by anchoring to child element #41268
- LinkControl UI goes off screen #42003
- Popover: pass missing anchor ref to the getAnchorRect callback prop #42076
- Popover:
expandOnMobilestyling is broken #42631 - Popover arrow not working properly in the latest versions #42820
- Popover: make sure that ownerDocument is always defined #42886
- Popover: anchor correctly to parent node when no explicit anchor is passed #42971
- ColorPalette, GradientPicker: fix color picker popover positioning #42989
- Fix block toolbar offset in site editor when toggling sidebars #43172
- Popover: fix and improve opening animation, use framer motion #43186
- Fix popover glitch that results in incorrect toolbar positioning in site editor #43267
- Popover: make sure offset middleware always applies the latest frame offset values #43329
- Site editor: do not show scrollbar when toolbar overflows the editor wrapper #43332
- Dropdown: anchor popover to the dropdown wrapper (instead of the toggle) #43377
- Fix legacy widget form positioning in customizer #43297
- Block Toolbar Regression - Toolbar obstructs selected blocks. #41575 : related PRs:
- Site editor: Block settings dropdown remains in place when scrolling #42725
- Block toolbar positioned under block in the site editor #43541
- Popover: make more reactive to prop changes, avoid unnecessary updates #43335
- User mention suggestions can't be exited from within a list block #43063
- Padding visualizers do not work properly in the Site Editor #41823
- Customize widgets: Link Popover not visible in full (Entire toolbar not visible) #41739
- Mover control: Block toolbar no longer sticks to block that's being moved until you scroll #44220
- Popover: fix limitShift logic by adding iframe offset correctly (and a custom shift limiter) #42950
- Block toolbar sometimes positioned incorrectly after dragging and dropping a block #44281
- Popover component overlay not fully visible in Customizer #43678
Improvements wish list:
- Improve code readability by adding more inline comments (Popover: tidy up code 🧹 , add more comments #42944)
- Improve Storybook examples (Popover: rewrite Storybook examples using controls #42903)
- Popover: rework props around shift, filp and resize behavior #43191
- There are currently many ways of passing an
anchor, we should settle on a few, refactor all components and mark the other legacy approaches as deprecated - Legacy
positionprop: - We should untangle the different
onClose-like callbacks and unify them to just one callback (link) - We should refactor all usages of the
Popoverusing CSS margins and try to refactor them to use theoffsetprop instead - Similarly, we should move away from the two other
__unstableprops:-
__unstableObserveElement(included in Popover: enable auto-updating every animation frame #43617) -
__unstableSlotName
-
- Add a popover
variantprop and refactor popovers to use it, deprecateisAlternate#45137 (see convo) - Find a better way to make widget editor popovers use
position: fixed. (see Fix popover stacking in the customize widgets editor #44282 for context) - Support for RTL opening animations
- In the context of all these changes, we could:
- rewrite the component to TypeScript and update the README
- rewrite the component's styles to use Emotion
- rewrite the current unit tests with modern testing library features
- Add more tests (both via RTL and via experimental viz reg)
Reacted by Matias Ventura and Daniel Richards
Reacted by George Mamadashvili and Nik Tsekouras
Metadata
Metadata
Assignees
Labels
[Package] Components/packages/components[Type] EnhancementA suggestion for improvement.[Type] Tracking IssueTactical breakdown of efforts across the codebase and/or tied to Overview issues.
Activity
renatho commentedon Jul 28, 2022
Hey! I imagine it's probably related to what I'm facing with the Popover arrow.
Using WP 6.0 with Gutenberg plugin deactivated (working):
With Gutenberg (
trunk) plugin activated (not working):ciampo commentedon Jul 29, 2022
Hey @renatho , it could be related — could you open a separate issue for this regression (where you can add more details and we can discuss further), so that we keep this issue as a master tracking issue? Thank you!
renatho commentedon Jul 29, 2022
Sure! Here is the issue: #42820
talldan commentedon Aug 2, 2022
I've added #42725 to the list. Hope that's ok!
ciampo commentedon Aug 2, 2022
Of course it is, thank you!
I must flag that I currently don't really have the capacity to work on this. I can try to squeeze some time and help, but we definitely need to understand who is going to work on these fixes
talldan commentedon Aug 12, 2022
I think I know what's happening here. There's no 'resize' listener for
frameOffset, so the value isn't updated. It looks like it works ok when opening the sidebar, but this is actually the 'shift' middleware being triggered by the block's position changing.The bug seems to specifically happen when inserting a new block and closing the sidebar, and I think that happens because the inserted block's toolbar is newly mounted, and a fresh
frameOffsetis calculated while the sidebar is open. Then, when closing the sidebar theframeOffsetstill retains the incorrect value.I can work on a fix for this (edit: fix in #43172).
Interestingly, I also just noticed this in the floating-ui docs:
https://floating-ui.com/docs/react-dom#variables-inside-middleware-functions
It suggests that any variable accessed through a closure by middleware functions needs to be a ref. That would also apply to
frameOffset.tellthemachines commentedon Aug 24, 2022
👋 I just created #43541 for what seems to be a related issue; may be related to the recently merged #42887.
talldan commentedon Aug 30, 2022
There are a couple of other issues here in the widgets customizer - Popover component overlay not fully visible in Customizer
ciampo commentedon Sep 3, 2026
Most tasks have been completed. The remaining ones are not planned anymore, as we're now dedicating most of our efforts on the new generation of components from the
@wordpress/uipackage, which features aPopover, too.