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 开始,它会在匹配项变化时调用 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
- 平均合并
- 9 小时 9 分钟
- 30 天内合并 PR
- 118
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
codercops/toolbelt 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 55/100
维护者通常 1 天内回复
-
JWT encoder signs payloads that aren't JSON objects, and the decoder then rejects them可能已有人在做 @MugdhoAI 于 1 天前认领。 未关闭bug good first issue hacktoberfest
codercops/toolbelt#253 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
JSON to YAML: control characters are written raw, so PyYAML and js-yaml can't read the output可能已有人在做 @anurag2787 于 1 天前认领。 未关闭bug good first issue hacktoberfest
codercops/toolbelt#234 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
JSON formatter: Escape for code gives broken Python when the text has a run of single quotes可能已有人在做 @anurag2787 于 2 天前认领。 未关闭bug good first issue hacktoberfest
codercops/toolbelt#233 · 3 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Add the URL encoder to the README, the home share card and package.json可能已有人在做 @Abhishek764 于 4 天前认领。 未关闭documentation good first issue hacktoberfest
codercops/toolbelt#153 · 4 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 codercops/toolbelt 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
db-ux-design-system/core-web#8613 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
bug:new
难度 1/5 1 小时以内 新手友好度 78/100
callstackincubator/simlock#934 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
gchq/LD-Explorer#286 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复