Skip to content

Commit e7e553c

Browse files
authored
Fix shifting focus to filter bar when typing / in a legit input (#5583)
* Fix shifting focus to filter bar when typing / in a legit input * Format
1 parent 01e8019 commit e7e553c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/plausible_web/components/generic.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ defmodule PlausibleWeb.Components.Generic do
878878
x-ref="filter_text"
879879
phx-debounce={200}
880880
autocomoplete="off"
881-
x-on:keydown.prevent.slash.window="$refs.filter_text.focus(); $refs.filter_text.select();"
881+
x-on:keydown.slash.window="if (['INPUT', 'TEXTAREA', 'SELECT'].includes(document.activeElement.tagName) || document.activeElement.isContentEditable) return; $refs.filter_text.focus(); $refs.filter_text.select();"
882882
x-on:keydown.escape="$refs.filter_text.blur(); $refs.reset_filter?.dispatchEvent(new Event('click', {bubbles: true, cancelable: true}));"
883883
value={@filter_text}
884884
x-on:focus={"$refs.filter_text.placeholder = '#{@placeholder}';"}

0 commit comments

Comments
 (0)