Fix for sending chat with ctrl enter for windows chrome/firefox. Fixes https://github.com/HabitRPG/habitica/issues/9380 (#9588)

* testing additional event trigger for sendMessage

* moved keyup event to newmessage

* added keyup event to tavern vue too

* removed obsolete check from _updateCarretPosition

* fixed lint issue
This commit is contained in:
Feywood
2017-12-05 21:05:01 +01:00
committed by Sabe Jones
parent 7caf211bec
commit 65e3b599e6
2 changed files with 2 additions and 12 deletions

View File

@@ -30,7 +30,7 @@
h3(v-once) {{ $t('chat') }}
.row.new-message-row
textarea(:placeholder="!isParty ? $t('chatPlaceholder') : $t('partyChatPlaceholder')", v-model='newMessage', @keydown='updateCarretPosition')
textarea(:placeholder="!isParty ? $t('chatPlaceholder') : $t('partyChatPlaceholder')", v-model='newMessage', @keydown='updateCarretPosition', @keyup.ctrl.enter='sendMessage()')
autocomplete(:text='newMessage', v-on:select="selectedAutocomplete", :coords='coords', :chat='group.chat')
.row
@@ -726,11 +726,6 @@ export default {
this._updateCarretPosition(eventUpdate);
}, 250),
_updateCarretPosition (eventUpdate) {
if (eventUpdate.metaKey && eventUpdate.keyCode === 13) {
this.sendMessage();
return;
}
let text = eventUpdate.target;
this.getCoord(eventUpdate, text);
},

View File

@@ -10,7 +10,7 @@
h3(v-once) {{ $t('tavernChat') }}
.row
textarea(:placeholder="$t('tavernCommunityGuidelinesPlaceholder')", v-model='newMessage', :class='{"user-entry": newMessage}', @keydown='updateCarretPosition')
textarea(:placeholder="$t('tavernCommunityGuidelinesPlaceholder')", v-model='newMessage', :class='{"user-entry": newMessage}', @keydown='updateCarretPosition', @keyup.ctrl.enter='sendMessage()')
autocomplete(:text='newMessage', v-on:select="selectedAutocomplete", :coords='coords', :chat='group.chat')
.row
@@ -532,11 +532,6 @@ export default {
this._updateCarretPosition(eventUpdate);
}, 250),
_updateCarretPosition (eventUpdate) {
if (eventUpdate.metaKey && eventUpdate.keyCode === 13) {
this.sendMessage();
return;
}
let text = eventUpdate.target;
this.getCoord(eventUpdate, text);
},