-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Fixed Position Toggle Button Not Taking Full Height #67403
base: trunk
Are you sure you want to change the base?
Fix: Fixed Position Toggle Button Not Taking Full Height #67403
Conversation
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
* | ||
* @default true | ||
*/ | ||
isLegacy?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a prop intended to be exposed publicly, and is likely to cause unintended side effects or maintenance headaches when used in this way. I also looked into the blame
for the flip logic and it seems like it was a pretty intentional hotfix for #63180. We do need to find a good fix for it though, to unblock CustomSelectControlV2. (cc @ciampo)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Also I think I'm open to setting flip
to true
for the legacy version as well, once the z-index issue is addressed.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we expose flip behaviour publicly via props? I think It would make more sense to allow for it instead of changing anything in legacy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Mayank-Tripathi32 , thank you for opening this PR.
Unfortunately, the proposed change goes against the strategy that we planned for this component (see #55023).
The isLegacy
prop is meant to remain private. We also plan on creating a new, V2 implementation where we're going to have the freedom of crafting a new API paradigm, while leaving the legacy version untouched for backwards compatibility reasons.
As @mirka also mentioned, we could consider changing the popover's flip
behaviour for the legacy version too, given that we can fix the side-effect reported in #63180
resolves #67401
What?
This PR adds a prop to
CustomSelectControl
to disable the legacy behavior and enable the new behavior of custom-select-v2. The new behavior, which includes flipping the dropdown, fixes the issue.Why?
In the WordPress block editor, the “Position” toggle button options in the Group block settings do not take up the full height of the settings panel. This causes a visual inconsistency, as users are required to scroll to see the full options.
How?
This PR introduces a new prop to
CustomSelectControl
that enables the new dropdown flipping behavior when there isn’t enough space below. It also adds the isLegacy={false} prop in the position support of the inspector. The customisLegacy
prop inCustomSelectControl
defaults to true to preserve the original behavior by default.Testing Instructions
Screencast
Screen.Recording.2024-11-29.at.12.35.38.AM.mov