Max 3000 Character Limit on Chat-Messages (#10494)

* limit chat length to 3000

* add test
This commit is contained in:
negue
2018-07-12 22:40:04 +02:00
committed by Sabe Jones
parent 2946f0df15
commit f6b34e85df
3 changed files with 26 additions and 2 deletions

View File

@@ -9,8 +9,10 @@
:class='{"user-entry": newMessage}',
@keydown='updateCarretPosition',
@keyup.ctrl.enter='sendMessageShortcut()',
@paste='disableMessageSendShortcut()'
@paste='disableMessageSendShortcut()',
maxlength='3000'
)
span {{ currentLength }} / 3000
autocomplete(
:text='newMessage',
v-on:select="selectedAutocomplete",
@@ -62,6 +64,11 @@
},
};
},
computed: {
currentLength () {
return this.newMessage.length;
},
},
methods: {
// https://medium.com/@_jh3y/how-to-where-s-the-caret-getting-the-xy-position-of-the-caret-a24ba372990a
getCoord (e, text) {