Skip to content
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

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/block-editor/src/hooks/position.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ export function PositionPanelPure( {
onChangeType( selectedItem.value );
} }
size="__unstable-large"
isLegacy={ false }
/>
</BaseControl>
</InspectorControls>
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/custom-select-control/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ function CustomSelectControl< T extends CustomSelectOption >(
value,
className: classNameProp,
showSelectedHint = false,
isLegacy = true,
...restProps
} = useDeprecatedProps( props );

Expand Down Expand Up @@ -189,7 +190,7 @@ function CustomSelectControl< T extends CustomSelectOption >(
'components-custom-select-control',
classNameProp
) }
isLegacy
isLegacy={ isLegacy }
{ ...restProps }
>
{ children }
Expand Down
9 changes: 9 additions & 0 deletions packages/components/src/custom-select-control/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,13 @@ export type CustomSelectProps< T extends CustomSelectOption > = {
* @default false
*/
__next40pxDefaultSize?: boolean;
/**
* Enables legacy behavior for the custom select dropdown.
*
* When set to `true`, the dropdown will follow the legacy implementation, including
* positioning and interaction styles. Set to `false` to use the updated behavior.
*
* @default true
*/
isLegacy?: boolean;
Copy link
Member

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)

Copy link
Member

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

Copy link
Contributor Author

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.

};
Loading