Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Remove inline requestSubmit handlers that double-submit collection filter forms

Đang mở Phù hợp với người mới
#2,824 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript, rails, ruby
Lĩnh vực
frontend, testing

Hướng nghiên cứu

Bắt đầu với các filter partial được liệt kê và xác nhận rằng mỗi inline handler nằm bên trong một form sử dụng Stimulus controller collection; issue cảnh báo rằng một số view khác phụ thuộc vào các handler này. Chờ #2815 được merge, sau đó làm theo mẫu request spec và system spec của issue đó: xác minh các handler không còn tồn tại và mỗi bộ lọc vẫn cập nhật kết quả. Với các form không có frame được bổ sung thao tác gửi văn bản có debounce, cũng cần tính đến bản sửa lỗi focus trong #2823.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

blocked

🤖 From Claude:

Many filter forms submit twice on each change, sending two requests where one would do.

Why it happens

  • These forms have the collection Stimulus controller, which already submits on select/date/checkbox changes and debounces text input.
  • Their fields also carry inline onchange/oninput="this.form.requestSubmit()", so each change fires a second request.
  • Inline text oninput also skips the debounce: it submits on every keystroke.

Likely affected (inline handler + collection in the same file)

  • app/views/quotes/_search_boxes.html.erb
  • app/views/topic_subscriptions/_search_boxes.html.erb
  • app/views/staff_taggings/_search_boxes.html.erb
  • app/views/features/_search_boxes.html.erb
  • app/views/stories/_search_boxes.html.erb
  • app/views/community_news/_search_boxes.html.erb
  • app/views/monthly_reports/_search_boxes.html.erb
  • app/views/comments_and_communications/_comments_and_communications_filters.html.erb
  • app/views/author_credit_divergences/_filters.html.erb
  • app/views/categories/_search_boxes.html.erb
  • app/views/notifications/_search_boxes.html.erb

Check first

  • Other views have inline requestSubmit without collection in the same file, e.g. sectors/_search_boxes, events/_funder_filter, events/_event_search_filter.
  • Only remove the handler where the field actually sits inside a collection form; otherwise it's the only thing submitting.

Fix (done for the comments filters and workshop logs in #2815)

  • Delete the inline handler; leave submitting to collection.
  • Request spec: the filter form has no onchange=/oninput=.
  • System spec: each filter still refreshes the results.
  • For frameless forms that gain debounced text submits, pair with the focus fix in #2823.

Blocked on

  • #2815 merging (reference fix and specs).
Ngôn ngữ chính
Ruby
Star
15
Fork
28
Merge trung bình
1 ngày 12 phút
Pull request đã merge (30 ngày)
262

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rubyforgood/awbw

Tất cả issue của rubyforgood/awbw

Issue tương tự

Thêm issue về Ruby

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.