Skip to content

Custom Select: dropdown-toggle trigger focus #4152

@flipswitchingmonkey

Description

@flipswitchingmonkey

Feature Request

Current State

Currently, with a searchable dropdown the input field is not focussed automatically, requiring an additional click to filter the values.

Request

Trigger focus() on input field when dropdown is opened to immediately allow filtering of value.

Workaround

😱

  function onDropdownToggle(e: ToggleEvent) {
    const input = (e.target as HTMLDetailsElement)
      ?.getElementsByTagName('article')?.[0]
      ?.getElementsByTagName('div')?.[0]
      ?.getElementsByClassName('db-input')?.[0]
      ?.getElementsByTagName('input')?.[0]
    if (input) {
      input.focus()
     }
  }

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions