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)

graph LR getOwnDropdown["getOwnDropdown"] findMatchingOption["findMatchingOption"] pickRandomOption["pickRandomOption"] selectMultipleOptions["selectMultipleOptions"] findMatchingOption -->|calls| getOwnDropdown pickRandomOption -->|calls| getOwnDropdown selectMultipleOptions -->|calls| getOwnDropdown style getOwnDropdown fill:#dbeafe,stroke:#2563eb,stroke-width:2px click getOwnDropdown "2e86cf83ed949de3.html" click findMatchingOption "fca1c8c5a316b388.html" click pickRandomOption "911dad38971ca0fd.html" click selectMultipleOptions "e53f83dda6e2588d.html"