mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 20:18:08 +00:00
fix: Handling markdown before replacing or appending signature [CW-2532] (#7944)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
This commit is contained in:
@@ -113,7 +113,6 @@ export default {
|
||||
});
|
||||
},
|
||||
setCursor() {
|
||||
const textarea = this.$refs.textarea;
|
||||
const bodyWithoutSignature = removeSignature(
|
||||
this.value,
|
||||
this.cleanedSignature
|
||||
@@ -121,9 +120,12 @@ export default {
|
||||
|
||||
// only trim at end, so if there are spaces at the start, those are not removed
|
||||
const bodyEndsAt = bodyWithoutSignature.trimEnd().length;
|
||||
const textarea = this.$refs.textarea;
|
||||
|
||||
textarea.focus();
|
||||
textarea.setSelectionRange(bodyEndsAt, bodyEndsAt);
|
||||
if (textarea) {
|
||||
textarea.focus();
|
||||
textarea.setSelectionRange(bodyEndsAt, bodyEndsAt);
|
||||
}
|
||||
},
|
||||
onInput(event) {
|
||||
this.$emit('input', event.target.value);
|
||||
@@ -157,7 +159,7 @@ export default {
|
||||
this.$emit('focus');
|
||||
},
|
||||
focus() {
|
||||
this.$refs.textarea.focus();
|
||||
if (this.$refs.textarea) this.$refs.textarea.focus();
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user