* Various Chat Fixes * Allow adding `@mention` anywhere (previously was fixed at the end of the text) * Add re-focus after mouseclick on `@mention` choice * Remove`@mention` space barrier (since server ingests mentions without spaces in between) Co-authored-by: Bart Enkelaar <benkelaar@gmail.com> * Boundry Search + Select shutoff Co-authored-by: Bart Enkelaar <benkelaar@gmail.com>
This commit is contained in:
@@ -117,7 +117,7 @@ export default {
|
||||
TOP: 0,
|
||||
LEFT: 0,
|
||||
},
|
||||
textbox: this.$refs,
|
||||
textbox: null,
|
||||
MAX_MESSAGE_LENGTH: MAX_MESSAGE_LENGTH.toString(),
|
||||
};
|
||||
},
|
||||
@@ -130,6 +130,9 @@ export default {
|
||||
return this.user.flags.communityGuidelinesAccepted;
|
||||
},
|
||||
},
|
||||
mounted () {
|
||||
this.textbox = this.$refs['user-entry'];
|
||||
},
|
||||
methods: {
|
||||
// https://medium.com/@_jh3y/how-to-where-s-the-caret-getting-the-xy-position-of-the-caret-a24ba372990a
|
||||
getCoord (e, text) {
|
||||
@@ -249,8 +252,13 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
selectedAutocomplete (newText) {
|
||||
selectedAutocomplete (newText, newCaret) {
|
||||
this.newMessage = newText;
|
||||
// Wait for v-modal to update
|
||||
this.$nextTick(() => {
|
||||
this.textbox.setSelectionRange(newCaret, newCaret);
|
||||
this.textbox.focus();
|
||||
});
|
||||
},
|
||||
|
||||
fetchRecentMessages () {
|
||||
|
||||
Reference in New Issue
Block a user