waitForDropdownClose function infrastructure ✓ 100.0%

Last updated: 2026-03-04T23:21:38.386Z

Metrics

LOC: 17 Complexity: 6 Params: 0 Coverage: 100.0% (10/10 lines, 0x executed)

Signature

waitForDropdownClose(): : Promise<void>

Summary

Waits until THIS select's dropdown is fully closed (or max ~600 ms). Prevents subsequent selects from picking options from a lingering portal.

Source Code

  async function waitForDropdownClose(): Promise<void> {
    const deadline = Date.now() + 600;
    while (Date.now() < deadline) {
      const dd = listboxId
        ? document
            .getElementById(listboxId)
            ?.closest<HTMLElement>(".ant-select-dropdown")
        : null;
      if (
        !dd ||
        dd.classList.contains("ant-select-dropdown-hidden") ||
        !document.contains(dd)
      )
        return;
      await new Promise((r) => setTimeout(r, 50));
    }
  }

No outgoing dependencies.

Impact (Incoming)

graph LR waitForDropdownClose["waitForDropdownClose"] selectOption["selectOption"] selectOption -->|calls| waitForDropdownClose style waitForDropdownClose fill:#dbeafe,stroke:#2563eb,stroke-width:2px click waitForDropdownClose "c6924900ef0c48e4.html" click selectOption "fe5ab67a02962060.html"
SourceType
selectOption calls