fix: float the standalone component dropdown so it overlays content#506
Merged
almothafar merged 1 commit intoJun 7, 2026
Merged
Conversation
The standalone `<ngui-auto-complete>` dropdown opening downward (the default)
was rendered in normal document flow, so it expanded its host element and
pushed sibling content down / scrolled the page. Only the upward `.dropup`
variant was floated.
Float the list by default (`position: absolute; top: 100%; inset-inline-start: 0;
z-index: var(--ngui-ac-z-index, 10)`), mirroring `.dropup`, so it overlays the
content below it. The directive renders this component inside a CDK overlay
(which floats and measures the list itself), so a scoped rule keeps the list in
normal flow there — `.cdk-overlay-pane .ngui-auto-complete > ul { position: static }`
— leaving the directive/overlay behavior unchanged.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
almothafar
added a commit
that referenced
this pull request
Jun 7, 2026
Added in the dropdown-overlay fix (#506) but missing from the README theming table. Documents the default (10) and that it applies to the standalone component's floating list (the directive's overlay uses its z-index input). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When
<ngui-auto-complete>is used as a standalone component and its dropdown opens downward (the default), the list<ul>is rendered in normal document flow. So it takes up layout space — expanding its host, growing the surrounding card, and scrolling the page — instead of floating over the content below.Only the upward
.dropupvariant was floated (position: absolute; bottom: 100%); the down case had no positioning. That asymmetry is the bug.Fix
In
auto-complete.component.scss, float the list by default, mirroring.dropup:The directive renders this same component inside a CDK overlay, which already floats the list and must measure its height to flip/reposition on overflow. So a single scoped rule keeps the list in normal flow only there, leaving the directive/overlay behavior byte-for-byte unchanged:
(The component uses
ViewEncapsulation.None, so these are plain global rules — no:host, and no directive change needed.)A new
--ngui-ac-z-indexCSS variable (default10) lets consumers adjust the float layer if it collides with other stacked UI.Validation
npm run build-lib:prod✅npm run build-docs✅npx ng test auto-complete→ 16/16 ✅ (incl. the directive overlay open/hide test)npm run format:check✅🤖 Generated with Claude Code