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

Stop the JSON formatter's Find bar from typing into the JSON

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

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

@kudala-bharani đang làm issue này rồi.

Từ ngày 19/10/2026.

  • #209 của @kudala-bharani — đang mở

Đá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
82/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ệ
nextjs, typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Bắt đầu từ effect ở dòng 34 đến 36 của app/(tools)/json-formatter/components/FindBar.tsx, effect này gọi onScrollTo mỗi khi danh sách kết quả khớp thay đổi. Sau đó đọc findScrollTo trong app/(tools)/json-formatter/JsonFormatterClient.tsx (dòng 309 đến 318), nơi textarea của trình soạn thảo nhận focus và vùng chọn được đặt với độ dài bằng không. Hoàn thành khi một truy vấn nhiều ký tự như email giữ focus trong ô Tìm, không làm thay đổi JSON, làm nổi bật kết quả khớp, và Enter, Shift+Enter, các nút mũi tên, Escape, bộ đếm và nút chuyển đổi hoa/thường vẫn hoạt động đúng theo tiêu chí chấp nhận. Kiểm tra bằng npm run lint, npm run test và npm run build.

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

Mô tả

bug hacktoberfest help wanted

In the JSON formatter, typing in the Find bar jumps into the JSON editor after the first character, so the rest of your search ends up typed into the document.

Steps to reproduce

  1. Load the example JSON and press Cmd/Ctrl+F.
  2. Type email.
  3. After the e, the caret moves into the editor and mail is inserted into the JSON.

Expected: focus stays in the Find box, the JSON doesn't change, and the match is highlighted. The match isn't highlighted today either, because the selection is set to zero length (pos to pos + 0).

The cause: FindBar calls onScrollTo in an effect every time the matches change, and findScrollTo calls el.focus() on the textarea.

Where to look

  • app/(tools)/json-formatter/components/FindBar.tsx (the effect at lines 34 to 36)
  • app/(tools)/json-formatter/JsonFormatterClient.tsx (findScrollTo, lines 311 to 320)

Acceptance criteria

  • Typing a multi-character query keeps focus in the Find box and leaves the JSON untouched
  • Enter, Shift+Enter and the arrow buttons move between matches and select the whole match
  • Escape closes the bar and puts focus back in the editor
  • The match counter and the case toggle still work
  • npm run lint, npm run test and npm run build pass

Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off develop, and open your PR against develop with Closes #121 in the description.

Ngôn ngữ chính
TypeScript
Star
1
Fork
9
Merge trung bình
10 giờ 24 phút
Pull request đã merge (30 ngày)
93

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

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 codercops/toolbelt

Tất cả issue của codercops/toolbelt

Issue tương tự

Thêm issue về TypeScript

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.