Skip to content

Commit

Permalink
fix(StatusChatInput): don't insert control characters
Browse files Browse the repository at this point in the history
@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
  • Loading branch information
caybro committed Jan 26, 2023
1 parent 9eb515e commit 9cb850f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ui/imports/shared/status/StatusChatInput.qml
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,9 @@ Rectangle {
}

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) {
textFormatMenu.close()
}
Expand Down

0 comments on commit 9cb850f

Please sign in to comment.