mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
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:
@@ -30,7 +30,7 @@
|
|||||||
h3(v-once) {{ $t('chat') }}
|
h3(v-once) {{ $t('chat') }}
|
||||||
|
|
||||||
.row.new-message-row
|
.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')
|
autocomplete(:text='newMessage', v-on:select="selectedAutocomplete", :coords='coords', :chat='group.chat')
|
||||||
|
|
||||||
.row
|
.row
|
||||||
@@ -726,11 +726,6 @@ export default {
|
|||||||
this._updateCarretPosition(eventUpdate);
|
this._updateCarretPosition(eventUpdate);
|
||||||
}, 250),
|
}, 250),
|
||||||
_updateCarretPosition (eventUpdate) {
|
_updateCarretPosition (eventUpdate) {
|
||||||
if (eventUpdate.metaKey && eventUpdate.keyCode === 13) {
|
|
||||||
this.sendMessage();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let text = eventUpdate.target;
|
let text = eventUpdate.target;
|
||||||
this.getCoord(eventUpdate, text);
|
this.getCoord(eventUpdate, text);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
h3(v-once) {{ $t('tavernChat') }}
|
h3(v-once) {{ $t('tavernChat') }}
|
||||||
|
|
||||||
.row
|
.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')
|
autocomplete(:text='newMessage', v-on:select="selectedAutocomplete", :coords='coords', :chat='group.chat')
|
||||||
|
|
||||||
.row
|
.row
|
||||||
@@ -532,11 +532,6 @@ export default {
|
|||||||
this._updateCarretPosition(eventUpdate);
|
this._updateCarretPosition(eventUpdate);
|
||||||
}, 250),
|
}, 250),
|
||||||
_updateCarretPosition (eventUpdate) {
|
_updateCarretPosition (eventUpdate) {
|
||||||
if (eventUpdate.metaKey && eventUpdate.keyCode === 13) {
|
|
||||||
this.sendMessage();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let text = eventUpdate.target;
|
let text = eventUpdate.target;
|
||||||
this.getCoord(eventUpdate, text);
|
this.getCoord(eventUpdate, text);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user