From 05c0cbb8398c28c4e8cc0e4e1ac597d199b65e33 Mon Sep 17 00:00:00 2001 From: Adrien Maston Date: Mon, 12 Jan 2026 12:52:42 +0100 Subject: [PATCH] Prevent autofocusing the filter input in drop downs --- app/assets/stylesheets/popup.css | 6 +++++- app/views/events/index/filter/_board.html.erb | 4 ++-- app/views/events/index/filter/_user.html.erb | 4 ++-- app/views/filters/settings/_assignees.html.erb | 5 ++--- app/views/filters/settings/_boards.html.erb | 5 ++--- app/views/filters/settings/_closers.html.erb | 5 ++--- app/views/filters/settings/_creators.html.erb | 5 ++--- app/views/filters/settings/_tags.html.erb | 5 ++--- 8 files changed, 19 insertions(+), 20 deletions(-) diff --git a/app/assets/stylesheets/popup.css b/app/assets/stylesheets/popup.css index 02ae8969e..86da3c55b 100644 --- a/app/assets/stylesheets/popup.css +++ b/app/assets/stylesheets/popup.css @@ -48,6 +48,10 @@ .popup__title { font-weight: 800; white-space: nowrap; + + &[tabindex="-1"]:focus-visible { + outline: unset; + } } /* Hide lists when all the items within are hidden */ @@ -155,7 +159,7 @@ max-inline-size: 100%; padding: var(--inline-space-half) var(--popup-item-padding-inline); text-align: start; - + &:focus-visible { z-index: 1; } diff --git a/app/views/events/index/filter/_board.html.erb b/app/views/events/index/filter/_board.html.erb index 326ce77f9..aa09042f9 100644 --- a/app/views/events/index/filter/_board.html.erb +++ b/app/views/events/index/filter/_board.html.erb @@ -16,8 +16,8 @@ <%= filter_dialog "Board…" do %> - Board… - <%= text_field_tag nil, nil, id: nil, placeholder: "Filter…", class: "input input--transparent txt-small font-weight-normal", autofocus: true, + <%= tag.strong "Board…", class: "popup__title", tabindex: (-1 if platform.mobile?), autofocus: platform.mobile? %> + <%= text_field_tag nil, nil, id: nil, placeholder: "Filter…", class: "input input--transparent txt-small font-weight-normal", autofocus: !platform.mobile?, type: "search", autocorrect: "off", autocomplete: "off", data: { "1p-ignore": "true", filter_target: "input", action: "input->filter#filter" } %>