mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-21 21:30:08 +00:00
Fix enter key check while composing characters
Chrome on macOS sends a KeyEvent with `key` set to `Enter`, the keyCode `229` and `isComposing` set to `true` when pressing enter while a character composition sequence is active, then an event for the composed key and ends with a Enter key event with the correct key code. This has thrown our Enter key detection off and resulted in sending of the wanted message and a public message with the single composed character as content. Ignoring the Enter key while characters are being composed seems to be safe.
This commit is contained in:
parent
ca74ca6538
commit
724540a8b2
@ -4,7 +4,7 @@
|
||||
* Use of this software is governed by the Business Source License
|
||||
* included in the LICENSE file.
|
||||
*
|
||||
* Change Date: 2022-08-16
|
||||
* Change Date: 2022-08-22
|
||||
*
|
||||
* On the date above, in accordance with the Business Source
|
||||
* License, use of this software will be governed by version 2
|
||||
@ -47,6 +47,11 @@ define([ '../console'
|
||||
|
||||
handleInputKeyDown(event) {
|
||||
if (EventKey.Enter(event) && !event.shiftKey) {
|
||||
if (event.isComposing) {
|
||||
console.debug('Ui/Input.handleInputKeyDown', 'Ignored Enter key while composing characters.')
|
||||
return
|
||||
}
|
||||
|
||||
// prevent generation of a new line
|
||||
event.preventDefault()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user