fix(StatusChatInput): don't insert control characters

@mentions have a special `onRelease()` key handler that makes sure a
space is inserted around the mention when needed. Fix the `onRelease()`
handler to prevent control or otherwise unprintable characters being
inserted as text.

Fixes: #7685
This commit is contained in:
Lukáš Tinkl 2023-01-25 19:31:22 +01:00 committed by Lukáš Tinkl
parent 9eb515e3e3
commit 9cb850f67f
1 changed files with 3 additions and 0 deletions

View File

@ -678,6 +678,9 @@ Rectangle {
} }
function onRelease(event) { function onRelease(event) {
if ((event.modifiers & Qt.ControlModifier) || (event.modifiers & Qt.MetaModifier)) // these are likely shortcuts with no meaningful text
return
if (event.key === Qt.Key_Backspace && textFormatMenu.opened) { if (event.key === Qt.Key_Backspace && textFormatMenu.opened) {
textFormatMenu.close() textFormatMenu.close()
} }