-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Unwanted scrollbars in Experimental Form block inspector dropdown #70306
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
Comments
I think the simplest fix would be the first point of discussion, but I would like this to be properly discussed before proceeding with a fix. |
I tested the first fix using the “Shorten the variation text in dropdown” approach, and it works well for this block. I’m okay with this patch as a solution for now. Additionally, I feel there should be a more general fix ideally one that handles longer strings by setting a maximum length, truncating excess text, and displaying the full content via a tooltip. |
Let's avoid this approach. It might solve the problem in the English locale, but not necessarily in other locales. We should always keep in mind that text length varies from locale to locale. Additionally, this problem may occur in other blocks with long variation names. Personally, I feel it's more natural to position the popover on the right: |
@t-hamano I tried all the possible props for the Could you please specify which placement prop worked for you? |
It would be better to delete this dropdown altogether, see #62904 for the reasons:
|
Uh oh!
There was an error while loading. Please reload this page.
Description
Discovered while working on #70249 and testing #70253
When opening the dropdown menu in the inspector controls of the Experimental Form block, both horizontal and vertical scrollbars appear unexpectedly. The scrollbars disappear when the dropdown is closed. This issue doesn't occur in other similar blocks like the Experimental Form Input block.
Expected behavior
The dropdown should:
Current behavior
Points of discussion -
Since it is a form block and the dropdown title, dropdown item description, and other contextual elements already support the 'form' keyword, this redundancy can be removed for better UX.
After investigating, I found that this was added in #44214 and modified in #51912 (just casing modifications)
white-space: nowrap
constraint and increase themin-width
(if necessary)The issue stems from the
white-space: nowrap
CSS rule introduced in the menu-itemstyle.css
file, which was added in #25218. This prevents text wrapping and causes horizontal overflow when menu items have long text. However, this would require a significant amount of testing.gutenberg/packages/components/src/menu-item/style.scss
Lines 67 to 75 in a5e3592
Changing the dropdown placement in the
DropdownMenu
component:gutenberg/packages/block-editor/src/components/block-variation-transforms/index.js
Lines 77 to 87 in a5e3592
I did not notice any significant difference when trying out various placement options, but I would like to mention this for completeness.
Note: The
position
prop inpopoverProps
is deprecated and should be replaced with theplacement
prop according to #44401, but this can be taken up in a different issue.Step-by-step reproduction instructions
Experimental Comment form
Screenshots, screen recording, code snippet
Screen.Recording.2025-06-03.at.15.51.49.mov
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: