Skip to content

CustomSelectControlV2: do not flip popover if legacy adapter#63357

Merged
ciampo merged 2 commits intotrunkfrom
feat/custom-select-control-flip-height
Jul 11, 2024
Merged

CustomSelectControlV2: do not flip popover if legacy adapter#63357
ciampo merged 2 commits intotrunkfrom
feat/custom-select-control-flip-height

Conversation

@ciampo
Copy link
Copy Markdown
Contributor

@ciampo ciampo commented Jul 10, 2024

What?

Part of #55023

Do not allow the select popover in the CustomSelectControl V2 legacy adapter to flip when there isn't much space to render below the trigger button.

Why?

This matches more closely the behavior of the legacy, downshift-based component and prevents (avoids it without solving) the issue reported in #63180

How?

By setting the flip property to false on the ariakit select popover

Testing Instructions

  • Render CustomSelectControlV2 legacy adapter and open the select popover
  • Resize its window until there is not enough space for the popover
  • Notice how the popover doesn't flip, but continues to render below the trigger button

Screenshots or screencast

Before (trunk) After (this PR)
Kapture.2024-07-10.at.16.32.46.mp4
Kapture.2024-07-10.at.16.36.45.mp4

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 10, 2024

Flaky tests detected in 061b9e2.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9887447341
📝 Reported issues:

@ciampo ciampo changed the title CustomSelectContorlV2: do not flip if legacy adapter CustomSelectContorlV2: do not flip popover if legacy adapter Jul 10, 2024
@ciampo ciampo self-assigned this Jul 10, 2024
@ciampo ciampo added [Type] Enhancement A suggestion for improvement. [Package] Components /packages/components labels Jul 10, 2024
@ciampo ciampo marked this pull request as ready for review July 10, 2024 14:41
@ciampo ciampo requested a review from ajitbohra as a code owner July 10, 2024 14:41
@ciampo ciampo requested a review from a team July 10, 2024 14:41
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 10, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: DaniGuardiola <daniguardiola@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@ciampo ciampo force-pushed the feat/custom-select-control-flip-height branch 2 times, most recently from be753a3 to 061b9e2 Compare July 11, 2024 07:40
@ciampo ciampo force-pushed the feat/custom-select-control-flip-height branch from 061b9e2 to 31195e6 Compare July 11, 2024 08:35
@ciampo ciampo changed the title CustomSelectContorlV2: do not flip popover if legacy adapter CustomSelectControlV2: do not flip popover if legacy adapter Jul 11, 2024
Copy link
Copy Markdown
Member

@DaniGuardiola DaniGuardiola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests well for me!

Copy link
Copy Markdown
Member

@tyxla tyxla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this 👍

@ciampo ciampo merged commit 098fe40 into trunk Jul 11, 2024
@ciampo ciampo deleted the feat/custom-select-control-flip-height branch July 11, 2024 10:26
@github-actions github-actions bot added this to the Gutenberg 18.9 milestone Jul 11, 2024
carstingaxion pushed a commit to carstingaxion/gutenberg that referenced this pull request Jul 18, 2024
…ss#63357)

* CustomSelectContorlV2: do not flip if legacy adapter

* CHANGELOG

---

Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: DaniGuardiola <daniguardiola@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Components /packages/components [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants