facebook/lexical

better support for keyboard accessibility

クローズ

#6,006 opened on 2024/05/02

 (6 件のコメント) (0 件のリアクション) (0 人の担当者)JavaScript (1,349 件のフォーク)batch import
contribution-weekenhancementgood first issue

Repository metrics

Stars
 (16,523 個のスター)
PR merge metrics
 (平均マージ 2d 16h) (30d で 103 merged PRs)

説明

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...

コントリビューターガイド