getOwnDropdown function infrastructure ✓ 100.0%
Last updated: 2026-03-04T23:21:38.386Z
Metrics
LOC: 13
Complexity: 5
Params: 0
Coverage: 100.0% (4/4 lines, 0x executed)
Signature
getOwnDropdown(): : HTMLElement | null
Summary
Returns the dropdown portal that belongs to THIS wrapper. Primary: resolves via aria-controls → listbox element → closest dropdown. Fallback: first visible dropdown (legacy / SSR builds that omit aria attrs). Scoping here prevents the race condition where a previous select's dropdown is still animating closed when this fill begins.
Source Code
function getOwnDropdown(): HTMLElement | null {
if (listboxId) {
const lb = document.getElementById(listboxId);
if (lb) {
const dd = lb.closest<HTMLElement>(".ant-select-dropdown");
if (dd && !dd.classList.contains("ant-select-dropdown-hidden"))
return dd;
}
}
return document.querySelector<HTMLElement>(
".ant-select-dropdown:not(.ant-select-dropdown-hidden)",
);
}
No outgoing dependencies.
Impact (Incoming)
| Source | Type |
|---|---|
| findMatchingOption | calls |
| pickRandomOption | calls |
| selectMultipleOptions | calls |