fix(CreateChannelPopup): cursor not jumping to the end

When typing at non-end position (in channel name filed) cursor
is no longer jumping to the end. Additionally binding loop
on "contentWidth" is fixed.

Closes: #7805
This commit is contained in:
Michał Cieślak 2022-11-08 22:28:37 +01:00 committed by Alexandra Betouni
parent 1ca1866993
commit cb4380582e
1 changed files with 3 additions and 3 deletions

View File

@ -98,7 +98,6 @@ StatusDialog {
Column { Column {
id: content id: content
width: parent.width
StatusInput { StatusInput {
id: nameInput id: nameInput
@ -108,8 +107,9 @@ StatusDialog {
placeholderText: qsTr("# Name the channel") placeholderText: qsTr("# Name the channel")
input.onTextChanged: { input.onTextChanged: {
input.text = Utils.convertSpacesToDashesAndUpperToLowerCase(input.text); const cursorPosition = input.cursorPosition
input.cursorPosition = input.text.length input.text = Utils.convertSpacesToDashesAndUpperToLowerCase(input.text)
input.cursorPosition = cursorPosition
if (root.channelEmoji === "") { if (root.channelEmoji === "") {
input.letterIconName = text; input.letterIconName = text;
} }