Undo the last action when clicking on the text field
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- html, react, typescript
- 领域
- frontend
调研方向
Reproduce the issue by placing MarkdownEditorView inside a label and clicking the editor’s text field; the “Undo” toolbar action is incorrectly triggered. Start with the editor component and its click/event handling around the toolbar and text input. Done means clicking within the text field no longer activates “Undo,” while the toolbar action still works when clicked directly.
由索引模型根据 Issue 内容生成。
描述
Отмена последнего действия при клике на текстовое поле
Description
Исходная компонента
import React from 'react';
import {
MarkdownEditorView,
useMarkdownEditor,
} from '@gravity-ui/markdown-editor';
import { toaster } from '@gravity-ui/uikit/toaster-singleton-react-18';
import { configure } from '@gravity-ui/markdown-editor';
configure({
lang: 'ru',
});
type Props = {
onChange: (value: string) => void;
};
export function Editor({ onChange }: Props) {
const editor = useMarkdownEditor({
initial: {
toolbarVisible: true,
},
});
React.useEffect(() => {
function changeHandler() {
const value = editor.getValue();
onChange(value);
}
editor.on('change', changeHandler);
return () => {
editor.off('change', changeHandler);
};
}, [editor, onChange]);
return (
<MarkdownEditorView
stickyToolbar
toaster={toaster}
editor={editor}
settingsVisible={false}
className="markdown-editor-wrapper"
/>
);
}
Проблема - если наш эдитор поставить в тег тогда при клике будет срабатывать кнопка "Отменить"
<label>
<Editor onChange={setDescription} />
</label>
https://github.com/user-attachments/assets/8b5f47bb-b158-4450-a78a-23a81534b5ee
- 主要语言
- TypeScript
- 星标
- 428
- 派生
- 48
- 平均合并
- 5 天 15 小时
- 30 天内合并 PR
- 47
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
gravity-ui/markdown-editor 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
gravity-ui/markdown-editor#1452 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
gravity-ui/markdown-editor#1293 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
gravity-ui/markdown-editor#1129 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 72/100
gravity-ui/markdown-editor#1450 ·
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 25/100
gravity-ui/markdown-editor#1331 ·
维护者通常 1 天内回复
查看 gravity-ui/markdown-editor 的全部 Issue
相似的 Issue
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
难度 2/5 1-3 小时 新手友好度 68/100
openclaw/openclaw#199885 · 2 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
-
feature needs-triage
难度 2/5 1-3 小时 新手友好度 78/100
BoardGamesEmpire/board-games-empire-backend#1306 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 80/100
sequant-io/sequant#1689 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 80/100