facebook/lexical

better support for keyboard accessibility

已关闭

#6,006 创建于 2024年5月2日

 (6 条评论) (0 个反应) (0 位负责人)JavaScript (1,349 个派生)batch import
contribution-weekenhancementgood first issue

仓库指标

星标
 (16,523 个星标)
PR 合并指标
 (平均合并 2天 16小时) (30 天内合并 103 个 PR)

描述

In general using "Enter" on a toolbar that makes changes to lexical is problematic.

Lets say I have a button that toggles "bold" and it's triggered using the "Enter" key on the mouse-down event which calls dispatchCommand(FORMAT_TEXT_COMMAND...) - this causes lexical to get focus and then handle the Enter key which can replace the selected text with a new line.

adding the e.preventDefault to the event solves this problem but the focus still moves from the toolbar to the editor.

I'm not sure how to handle this...

贡献者指南