❯ ~/robonen/tools
core
  • stdlibapi
  • platformapi
  • fetchapi
  • encodingapi
  • crdtapi
vue
  • vueapi
    ❯
    guide
    • Introduction
    • ❯assignStyle
    • ❯createGuardAttrs
    • ❯decodeCookieValue
    • ❯dispatchAnimationEvent
    • ❯encodeCookieName
    • ❯encodeCookieValue
    • ❯findCardBrand
    • ❯findFirstVisible
    • ❯findLastVisible
    • ❯findPhoneCountry
    • ❯focus
    • ❯focusFirst
    • ❯focusGuard
    • ❯getActiveElement
    • ❯getAnimationName
    • ❯getCookieValue
    • ❯getCountryFlagByCode
    • ❯getTabbableCandidates
    • ❯getTabbableEdges
    • ❯getTranslate
    • ❯hideOthers
    • ❯isAnimatable
    • ❯isEventTarget
    • ❯isHidden
    • ❯isInView
    • ❯isIOS
    • ❯isIPad
    • ❯isIPhone
    • ❯isMac
    • ❯isMobileFirefox
    • ❯isSafari
    • ❯isSelectableInput
    • ❯isValidCardNumber
    • ❯onAnimationSettle
    • ❯parseCookieString
    • ❯pxValue
    • ❯readInputState
    • ❯resetStyle
    • ❯serializeCookie
    • ❯setStyle
    • ❯shouldSuspendUnmount
    • ❯testUserAgentPlatform
    • ❯writeInputState
  • writekitapi
  • primitivesui
configs
  • eslintguide
  • tsconfigguide
  • tsdownguide
infra
  • renovateguide
@robonen/vue/focusFirst
fn

focusFirst

v0.0.5

Attempts to focus the first element from a list of candidates. Stops when focus actually moves.

Source

Signature

ts
declare function focusFirst(candidates: HTMLElement[], { select }?: {
  select?: boolean | undefined;
}): boolean;

Parameters

ParameterTypeDefaultDescription
candidatesHTMLElement[]——
{ select }?{ select?: boolean | undefined; }——

Returns

boolean
on this page
  • Signature
  • Parameters
  • Returns