Using Turbo 8 via turbo-rails 2.0.11:
autofocus
did not work for me. It always moves the cursor to the start of the line in Firefox. Also, only one input field can have autofocus, but maybe I should have tried adding an ID for this.
The turbo_permanent
attribute works great. I am using #search to automatically submit after a certain timeout, triggering Turbo.visit(url, { action: "replace" })
to also update the GET params in the URL, no POST request needed.
<%= form.text_field :test_name,
placeholder: "Filter by test name...",
value: params[:test_name] || session[:test_name],
data: {
turbo_permanent: true,
action: "input->search-form#search keypress->search-form#submitOnEnter"
} %>