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

貢獻者指南