Autocomplete: dropdown never flips above the field (opens below the viewport) and is clipped by the fieldset "overflow: clip"
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, php, symfony
- Domain
- accessibility, frontend
Research direction
Start with assets/js/autocomplete.js and the theme CSS for .form-fieldset-body; the issue identifies both as sources of the dropdown placement and clipping behavior. Review the autocomplete setup and existing fieldset overflow rules, then reproduce the reported behavior in a short viewport and with the clipping mitigation disabled. Done means the dropdown remains visible near the viewport edge and is not clipped inside fieldsets; the payload does not name a test file.
Written by the indexing model from the issue text.
Description
Describe the bug
A ChoiceField / autocomplete placed as the last field of a fieldset opens its TomSelect list downwards — and nothing flips or clamps it, so when the field sits near the lower edge of the window the list opens (almost) entirely below the viewport: the user clicks the select and sees an empty/near-empty dropdown.
The bundled TomSelect has no placement logic at all: positionDropdown() returns immediately unless dropdownParent === 'body', and even then it positions the list strictly below the control (top = control.offsetHeight + rect.top + window.scrollY). There is no flip/clamp in 2.4.1 (the version pinned in yarn.lock) and none in upstream master (2.6.2). When the wrapper is not body, the position comes from the theme CSS (inset-block-start: 100%), i.e. always below. EA never sets dropdownParent when creating the widget (assets/js/autocomplete.js — grep dropdownParent finds nothing from 5.2.0 to 5.7.0).
Measured on a settings CRUD form (EA 5.6.1, Symfony 7.x, PHP 8.x), 249 px tall list, control at y = 257:
| viewport height | list position | really visible in the viewport |
|---|---|---|
| 700 px | 290–539 px | 246 px |
| 540 px | 290–539 px | 246 px |
| 480 px | 290–539 px | 186 px |
| 400 px | 290–539 px | 108 px |
| ≤ 290 px | 290–539 px | 0 px (the document does grow, so a manual scroll reaches it — but the list is not visible when it opens) |
So the smaller the window (or the lower the field after scrolling), the worse it gets; in a short window the dropdown looks like it "does not open".
Second, related problem: the list is rendered inside the clipped fieldset body
TomSelect appends .ts-dropdown inside the field wrapper (.ts-wrapper), i.e. inside .form-fieldset-body, which has overflow: clip for the collapse animation. EA mitigates that with:
.form-fieldset-body.show:not(.collapsing) {
overflow-inline: clip;
overflow-block: visible;
}
That mitigation depends on the overflow-inline / overflow-block logical longhands, and only covers .show:not(.collapsing). Where the longhands do not apply (Chrome < 135, Safari < 26, WebView — see also #7235 and #7050, where these logical overflow properties caused autocomplete problems on Safari and mobile Chrome) or while a body is collapsed/animating, the physical overflow: clip wins and only ~18 px of the list are painted — the dropdown looks invisible even in a tall window.
Reproduction of that half (any browser — just drop the mitigation in DevTools):
.form-fieldset-body.show:not(.collapsing) { overflow: clip !important; }
.form-fieldset-body.show:not(.collapsing) > .row { overflow: clip !important; }
Measured with document.elementFromPoint() probes at 1280×700 (Chrome 155 and Firefox 158): the fieldset body box is 144–311 px, .ts-dropdown is 290–539 px; painted dropdown goes from 18 px (290–308) to 240 px (292–532) as soon as the mitigation applies.
Suggested fix
- Placement (the reported symptom): position the list against the viewport — flip above the control or clamp its height/max-height when there is not enough room below. TomSelect upstream has no such logic, so it has to live in
assets/js/autocomplete.js/ the EA theme. - Clipping: set
dropdownParent: 'body'when creating the widget inassets/js/autocomplete.js— the list then leaves the clipped box (verified here:parentElementof.ts-dropdownbecomes<body>, no clipping ancestor remains, and TomSelect keeps re-anchoring it to the control on window scroll/resize). Alternatively applyoverflow: cliponly while a fieldset is actually collapsing (.form-fieldset-body.collapsing,.collapse:not(.show)) instead of on every body, or clip withclip-pathonly during the animation and drop it afterwards.
Workaround for users (documented hook)
document.addEventListener('ea.autocomplete.pre-connect', (event) => {
event.detail.config.dropdownParent = 'body';
});
Environment
- EasyAdminBundle 5.6.1 (the clipping CSS is present in 5.2.0 … 5.7.0)
- TomSelect 2.4.1 (
yarn.lock); upstream 2.6.2 has the samepositionDropdown() - Symfony 7.x, PHP 8.x
- Reported by a user on Firefox 157 (Linux, 1920×1000 window; the field ends up near the lower window edge): "when the dropdown is at the bottom, you can't see it when it opens". Verified with Chrome 155 and Firefox 158.
- Dominant language
- PHP
- Stars
- 4.3k
- Forks
- 1.1k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 52
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from EasyCorp/EasyAdminBundle
-
bug design
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
EasyCorp/EasyAdminBundle#7958 ·
Maintainers usually reply within 2 days
-
design feature
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
EasyCorp/EasyAdminBundle#7930 ·
Maintainers usually reply within 2 days
-
design
Difficulty 2/5 Under an hour Newbie friendliness 88/100
EasyCorp/EasyAdminBundle#7879 ·
Maintainers usually reply within 2 days
-
design
Difficulty 1/5 Under an hour Newbie friendliness 90/100
EasyCorp/EasyAdminBundle#7875 ·
Maintainers usually reply within 2 days
-
#[AdminRoute]: the requirements of an action silently replace the ones of the classPossibly taken @anthonyhacart claimed this 1 day ago. Openfeature
Difficulty 3/5 Half a day Newbie friendliness 30/100
EasyCorp/EasyAdminBundle#7956 ·
Maintainers usually reply within 2 days
All issues in EasyCorp/EasyAdminBundle
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
taskforcesh/bullmq#5238 ·
Maintainers usually reply within 1 day
-
[Bug] v-change-database-password reports success but doesn't change the password when MySQL validate_password rejects itPossibly taken @bfs2021 claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Automattic/jetpack#55517 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
area/import type/enhancement when/later
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day