Skip to content

Popover: polish component after recent refactor #42770

Closed

Description

@ciampo

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):

Improvements wish list:

Activity

  1. added
    [Type] Enhancement
    [Package] Components
    on Jul 28, 2022
  2. renatho commented on Jul 28, 2022

    @renatho
    Contributor

    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):

    screen_shot_2022-07-28_at_11 13 12

    With Gutenberg (trunk) plugin activated (not working):

    screen_shot_2022-07-28_at_11 16 46

  3. ciampo commented on Jul 29, 2022

    @ciampo
    ContributorAuthor

    Hey! I imagine it's probably related to what I'm facing with the Popover arrow.

    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!

  4. renatho commented on Jul 29, 2022

    @renatho
    Contributor

    Hey! I imagine it's probably related to what I'm facing with the Popover arrow.

    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!

    Sure! Here is the issue: #42820

  5. talldan commented on Aug 2, 2022

    @talldan
    Contributor

    I've added #42725 to the list. Hope that's ok!

  6. ciampo commented on Aug 2, 2022

    @ciampo
    ContributorAuthor

    I've added #42725 to the list. Hope that's ok!

    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

  7. added
    [Type] Tracking Issue
    on Aug 4, 2022
  8. talldan commented on Aug 12, 2022

    @talldan
    Contributor

    The popover's offset doesn't update when the block/pattern inserter is closed (#42417 (comment)) (needs to be confirmed if the regression is caused by the refactor to floating UI)

    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 frameOffset is calculated while the sidebar is open. Then, when closing the sidebar the frameOffset still 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.

  9. tellthemachines commented on Aug 24, 2022

    @tellthemachines
    Contributor

    👋 I just created #43541 for what seems to be a related issue; may be related to the recently merged #42887.

  10. talldan commented on Aug 30, 2022

    @talldan
    Contributor

    There are a couple of other issues here in the widgets customizer - Popover component overlay not fully visible in Customizer

  11. ciampo commented on Sep 3, 2026

    @ciampo
    ContributorAuthor

    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/ui package, which features a Popover, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Package] Components[Type] Enhancement[Type] Tracking Issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions