Event missing using keymap
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- react, typescript
- 领域
- frontend
调研方向
首先,根据 issue 中显示的 keymap.of 和 extraKeys handler,重现所报告的 Enter 和 Shift-Enter 行为。跟踪事件处理的入口点,并验证在 issue 解决后,handler 是否接收到预期的事件,并按照描述停止或阻止传播。
由索引模型根据 Issue 内容生成。
描述
Hello sr!
For some reason that I ignore, after upgrading version (I guess that was what happen), I stop getting the event in the handler of an extra key specified in keymap (and I do need to stop event propagation):
<CodeMirror
extensions={[Prec.highest(keymap.of(this.extraKeys()))]}
theme={this.theme()}
value={value}
onChange={this.valueChanged}
/>
extraKeys() {
return [
{
key: "Enter",
run: this.enterPressed,
},
{
key: "Shift-Enter",
run: this.enterPressed,
},
];
}
enterPressed = (editor, event) => {
if (event.shiftKey || event.altKey) {
event.stopPropagation();
return;
}
event.preventDefault();
if (this.props.onAccept) this.props.onAccept();
this.clear();
return true;
};
Any help is wellcome. Thanks!
- 主要语言
- TypeScript
- 星标
- 2.3k
- 派生
- 162
- 平均合并
- 2 小时 41 分钟
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
uiwjs/react-codemirror 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 64/100
uiwjs/react-codemirror#766 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
uiwjs/react-codemirror#765 ·
-
难度 3/5 1-2 天 新手友好度 35/100
uiwjs/react-codemirror#772 ·
-
难度 4/5 3-5 天 新手友好度 48/100
uiwjs/react-codemirror#770 ·
-
难度 3/5 1-2 天 新手友好度 48/100
uiwjs/react-codemirror#767 · 2 条评论 ·
查看 uiwjs/react-codemirror 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
paperclipai/paperclip#16785 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
code-yeongyu/senpi#3661 ·
维护者通常 1 天内回复
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
难度 1/5 1 小时以内 新手友好度 78/100
lingdojo/kana-dojo#32731 · 1 条评论 · 5 个 reaction ·
维护者通常 1 天内回复
-
bug status: needs triage
难度 2/5 1-3 小时 新手友好度 76/100
mastra-ai/mastra#27538 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
Yeachan-Heo/oh-my-codex#3822 ·
维护者通常 1 天内回复