Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(chat/web) fixed 2 byte char duplication (#11332)

Calinteodor41c068feafb4
diff --git a/react/features/chat/components/web/ChatInput.js b/react/features/chat/components/web/ChatInput.js
index a21593d51f..3a40c76c17 100644
--- a/react/features/chat/components/web/ChatInput.js
+++ b/react/features/chat/components/web/ChatInput.js
@@ -219,6 +219,18 @@ class ChatInput extends Component<Props, State> {
* @returns {void}
*/
_onDetectSubmit(event) {
+ // Composition events used to add accents to characters
+ // despite their absence from standard US keyboards,
+ // to build up logograms of many Asian languages
+ // from their base components or categories and so on.
+ if (event.isComposing || event.keyCode === 229) {
+ // keyCode 229 means that user pressed some button,
+ // but input method is still processing that.
+ // This is a standard behavior for some input methods
+ // like entering japanese or сhinese hieroglyphs.
+ return;
+ }
+
if (event.key === 'Enter'
&& event.shiftKey === false
&& event.ctrlKey === false) {