Keep focus when typing in full-page filter forms that auto-submit

Aperta
#2,823 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rails, ruby
Ambito
frontend, testing

Direzione di ricerca

Read the “Lazy index/filter frames” section in CLAUDE.md and the reference implementation in #2815; this issue is explicitly blocked on that pull request merging. Then update the six listed filter views and add a system spec for each page that types through the auto-submit; done means the final input value and URL are preserved.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

blocked

🤖 From Claude:

Typing in a filter box on these pages reloads the whole page after a short pause, so the cursor leaves the box and any further typing is lost.

Why it happens

  • The collection Stimulus controller auto-submits text fields 400 ms after typing stops.
  • On these pages the filter form isn't inside a results Turbo Frame, so each submit is a full-page visit that drops focus.

Affected pages (frameless filter forms using collection, with text filters)

  • app/views/quotes/_search_boxes.html.erb
  • app/views/faqs/_search_boxes.html.erb
  • app/views/story_ideas/_search_boxes.html.erb
  • app/views/workshop_variation_ideas/_search_boxes.html.erb
  • app/views/forms/results.html.erb
  • app/views/bookmarks/tally.html.erb

Fix (already used on workshop logs in #2815)

  • turbo_refreshes_with method: :morph, scroll: :preserve in the page view.
  • data: { turbo_action: "replace" } on the filter form.
  • data-turbo-permanent plus an id on any TomSelect wrapper so the morph doesn't strip its widget.
  • System spec per page: type, pause long enough to submit, keep typing, and assert the final value + URL.
  • Pattern documented in CLAUDE.md → "Lazy index/filter frames".

Blocked on

  • #2815 merging (it introduces the pattern and the reference implementation).
Lingua principale
Ruby
Stelle
15
Fork
28
Merge medio
16h 38m
PR unite (30g)
298

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rubyforgood/awbw

Tutte le issue di rubyforgood/awbw

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.