Fix completion when tabing users
This was caused by weird bindings. Now just access the userId value directly. Fix #324
This commit is contained in:
@@ -371,7 +371,7 @@ ToolBar {
|
||||
function complete() {
|
||||
documentHandler.replaceAutoComplete(completionMenu.currentDisplayText);
|
||||
if (completionMenu.completionType === ChatDocumentHandler.User) {
|
||||
userAutocompleted[completionMenu.currentDisplayText] = completionMenu.currentUserId;
|
||||
userAutocompleted[completionMenu.currentDisplayText] = completionMenu.currentItem.userId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,8 +22,7 @@ Popup {
|
||||
property alias delegate: completionListView.delegate
|
||||
|
||||
// Autocomplee text
|
||||
property string currentDisplayText: currentItem && currentItem.displayName ? currentItem.displayName : ""
|
||||
property string currentUserId: currentItem && currentItem.id ? currentItem.id : ""
|
||||
property string currentDisplayText: currentItem && (currentItem.displayName ?? "")
|
||||
|
||||
property int completionType: ChatDocumentHandler.Emoji
|
||||
property int beginPosition: 0
|
||||
@@ -78,6 +77,7 @@ Popup {
|
||||
id: usernameItem
|
||||
width: ListView.view.width ?? implicitWidth
|
||||
property string displayName: modelData.displayName
|
||||
property string userId: modelData.id
|
||||
leading: Kirigami.Avatar {
|
||||
implicitHeight: Kirigami.Units.gridUnit
|
||||
implicitWidth: implicitHeight
|
||||
@@ -86,11 +86,6 @@ Popup {
|
||||
}
|
||||
text: modelData.displayName
|
||||
onClicked: completeTriggered();
|
||||
Component.onCompleted: {
|
||||
completionMenu.currentUserId = Qt.binding(() => {
|
||||
return modelData.id ?? "";
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user