Stop the JSON formatter's Find bar from typing into the JSON
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 82/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- nextjs, typescript
- 領域
- frontend
調査の方向性
まず app/(tools)/json-formatter/components/FindBar.tsx の34〜36行目にあるeffectから読み始めてください。このeffectは一致箇所が変わるたびに onScrollTo を呼び出します。次に app/(tools)/json-formatter/JsonFormatterClient.tsx の findScrollTo(309〜318行目)を読んでください。ここではエディタの textarea にフォーカスが移り、選択範囲の長さがゼロに設定されます。email のような複数文字の検索語を入力したときに、フォーカスが検索ボックスに残り、JSONが変更されず、一致箇所がハイライトされ、Enter、Shift+Enter、矢印ボタン、Escape、件数表示、大文字小文字の切り替えが受け入れ基準どおりに動作すれば完了です。npm run lint、npm run test、npm run build で確認してください。
索引モデルが issue の本文から書いたものです。
説明
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
- Load the example JSON and press Cmd/Ctrl+F.
- Type
email. - After the
e, the caret moves into the editor andmailis 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 testandnpm run buildpass
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.
- 主要言語
- TypeScript
- スター
- 1
- フォーク
- 9
- 平均マージ
- 10時間 24分
- マージ済み PR(30日)
- 93
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
codercops/toolbelt のほかの issue
-
bug good first issue hacktoberfest
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
bug good first issue hacktoberfest
難易度 2/5 1〜3時間 初心者へのやさしさ 94/100
メンテナーはふだん 1 日以内に返信
-
bug good first issue hacktoberfest
難易度 2/5 1〜3時間 初心者へのやさしさ 92/100
メンテナーはふだん 1 日以内に返信
-
JSON formatter: a duplicate key crashes the whole tool対応中かも @lb1192176991-lab が今日担当しました。 オープンbug good first issue hacktoberfest
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
codercops/toolbelt#218 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
JSON to XML: keys like `@type`, `$ref` or `bad key` turn into `<item>`対応中かも @AyanZahid-Code が今日担当しました。 オープンbug good first issue hacktoberfest
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
codercops/toolbelt#214 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
codercops/toolbelt の issue をすべて見る
似ている issue
-
Area/Cloud Needs Triage Type/Bug
難易度 1/5 1〜3時間 初心者へのやさしさ 86/100
wso2/product-integrator#2847 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
bluesky-social/social-app#12118 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
heygen-com/hyperframes#6021 ·
メンテナーはふだん 1 日以内に返信
-
check:passed streams:edit
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信