Problem/Motivation
Multi-select (combobox) list items "escape" bounding box in off-canvas forms in Chrome. This happened in the past: #3043467: Multi-select list items "escape" bounding box in Off-Canvas Forms when using WebKit and Mozilla based browsers, but it looks like it broke again at some point. Perhaps due to #2958588: Off-canvas style resets are overriding styles (especially SVGs) resulting in display issues, I'm not sure.

It looks fine in FireFox.
Steps to reproduce
- Install fresh site from 9.x and use "Standard" profile
- Enable Layout Builder
- Add at least 5 terms to the existing "Tags" vocabulary
- Add a custom block type and add a term reference field to the tags vocabulary. Allow unlimited items
- Update form display widget for that block type to use a select list
- Enable layout builder for the existing "Basic Page" content type default entity view display
- Edit layout, add block, and select "Add Custom Block"
- Add the new block you created, and observe the issue
Proposed resolution
Apply "overflow: auto" to "#drupal-off-canvas select[multiple]" fixes it
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | after patch.png | 19.58 KB | akhildev.cs |
| #10 | before patch.png | 18.67 KB | akhildev.cs |
| #9 | interdiff_2-8.txt | 1.36 KB | jeremyvii |
| #9 | 3215517-8.patch | 2.72 KB | jeremyvii |
| #6 | After Patch 3215517 one.png | 479.48 KB | chetanbharambe |
Comments
Comment #2
sagarchauhan commentedAdding patch as per Proposed resolution
Comment #3
gauravvvv commentedRather than making overflow scroll, we can wrap the text.
Adding after-patch screenshot and interdiff as well. Please review.
After patch, with word wrap.

Comment #4
gauravvvv commentedComment #5
abhijith s commentedApplied patch #4 and it solves the problem with multi-select box in layout builder.
Adding screenshots.

Before patch:
After patch:

RTBC +1
Comment #6
chetanbharambe commentedVerified and tested patch #4.
Patch applied successfully but not working as expected.
Testing Steps:
# Goto: 9.3.x-dev version with Seven theme
# Goto: Extend -> Enable Layout Builder
# Add at least 5 terms to the existing "Tags" vocabulary - "admin/structure/taxonomy/manage/tags/overview"
# Add a custom block type and add a term reference field to the tags vocabulary. Allow unlimited items
# Update form display widget for that block type to use a select list
# Enable layout builder for the existing "Basic Page" content type default entity view display
# Edit layout, add a block, and select "Add Custom Block"
# Add the new block you created and observe the issue
Expected Results:
# Created taxonomy terms should not be broken and they should not go outside of the box
# There should be some vertical scrolling effect for created taxonomy vocabularies.
Actual Results:
# Currently taxonomy terms are going to outside of the box
# There is no vertical scrolling effect for taxonomy terms if there are more than 8-9 vocabularies.
Please refer attached screenshots for the same.
Not working as expected.
Can be a move to Needs Work.
Comment #7
gauravvvv commentedThis is a separate issue, you can open a follow-up issue for that. this issue can be seen in the before patch screenshot as well.

Comment #9
jeremyvii commentedI believe the best course of action for this issue is to apply
overflow: autoto#drupal-off-canvas select[multiple]. The purpose of theoff-canvas.reset.cssfile is to reset the off canvas dialog back to the browser defaults, andoverflow: autoachieves this.I created a new patch, based on patch #2, that applies the style to the stable and stable9 themes.
Comment #10
akhildev.cs commentedHi jeremyvii, it looks great.
Applied patch #9 solves this issue for 9.4.x-dev.
patch applied on:-
Drupal version : 9.4.x-dev
Theme : bartik
Comment #11
clayfreemanRTBC++
Comment #13
jeremyvii commentedMarking as RTBC since the tests pass after a rerun.
Comment #14
gauravvvv commentedComment #17
lauriiiI think it's fine to make this change to Stable because it seems low risk as it only impacts overflow of the multi-select element in off-cavas.
Committed 73f695b and pushed to 10.0.x. Also cherry-picked to 9.4.x. Thanks!