Microsoft/react-native-windows

Add isComposing to onKeyDown/onKeyUp

Open

#5,821 建立於 2020年8月24日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)C# (544 fork)batch import
Needs: Dev DesignPartner: FacebookWorkstream: Component Parityenhancementhelp wanted

倉庫指標

Star
 (6,114 star)
PR 合併指標
 (平均合併 4天 14小時) (30 天內合併 45 個 PR)

描述

See comment for context. Copying from necolas's comment:

The event has an isComposing property set to true in that case. However, it's a bit more complicated (and inconsistent across browsers) than that and there has been discussion about what the timing of the composition events (compositionstart, compositionend [ref]) and when the isComposing property should be true. So in practice, on the web you also have to check whether the keyCode is a magic number 229 which indicates IME composition.

The work I'm doing on interactions will probably add onCompositionStart/End events and prevent all IME events from triggering onKeyDown and onKeyUp events, as the vast majority of developers aren't aware of IME and end up breaking things by acting on key events like Enter that are actually occurring during composition.

Some IME-related discussion here: necolas/react-native-web#1538 (comment)

貢獻者指南