Member Junction
    Preparing search index...
    • Pick the single best match among an ambiguous selector's candidates.

      Policy, in order:

      1. Prefer visible matches; fall back to all matches when none are visible (better to attempt the action and let Playwright's actionability check report a real reason than to refuse outright).
      2. Among those, take the SMALLEST by area. For the dominant failure mode — a :has-text() ancestor chain — the smallest match is the innermost element, which is the element the controller actually meant.
      3. Ties break on document order (lowest index), matching what Playwright's own non-strict APIs do.

      Parameters

      Returns number | undefined

      the chosen Index, or undefined when there are no candidates.