diff --git a/app/javascript/controllers/navigable_list_controller.js b/app/javascript/controllers/navigable_list_controller.js index e7af08134..a5aa1a94f 100644 --- a/app/javascript/controllers/navigable_list_controller.js +++ b/app/javascript/controllers/navigable_list_controller.js @@ -79,13 +79,11 @@ export default class extends Controller { this.#clearSelection() selectedItem.setAttribute(this.selectionAttributeValue, "true") this.currentItem = selectedItem - + await nextFrame() + if (this.focusOnSelectionValue) { this.currentItem.focus() } if (this.hasInputTarget && id) { this.inputTarget.setAttribute("aria-activedescendant", id) } - - await nextFrame() - if (this.focusOnSelectionValue) { this.currentItem.focus() } } } diff --git a/app/views/cards/index/_header.html.erb b/app/views/cards/index/_header.html.erb index 61fdc3bcd..b945bed15 100644 --- a/app/views/cards/index/_header.html.erb +++ b/app/views/cards/index/_header.html.erb @@ -30,7 +30,7 @@ navigable_list_actionable_items_value: true } do %>
<%= text_field_tag :search, nil, placeholder: "Filter…", class: "input input--transparent txt-small", autofocus: true, - type: "search", autocorrect: "off", autocomplete: "off", data: { "1p-ignore": "true", filter_target: "input", navigable_list_target: "input", action: "input->filter#filter" }, aria: { activedescendant: "filter-hotkey-1" } %> + type: "search", autocorrect: "off", autocomplete: "off", data: { "1p-ignore": "true", filter_target: "input", navigable_list_target: "input", action: "input->filter#filter" }, role: "combobox", aria: { activedescendant: "" } %>