FIX: do not autofocus input on edit in mobile (#26554)

This commit is contained in:
Joffrey JAFFEUX 2024-04-08 14:02:36 +02:00 committed by GitHub
parent 32e0a0a0d3
commit 0bee802ccc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View File

@ -13,6 +13,7 @@ export default class ChatChannelComposer extends Service {
@service loadingSlider; @service loadingSlider;
@service capabilities; @service capabilities;
@service appEvents; @service appEvents;
@service site;
@tracked textarea; @tracked textarea;
@tracked scrollable; @tracked scrollable;
@ -48,8 +49,11 @@ export default class ChatChannelComposer extends Service {
this.chat.activeMessage = null; this.chat.activeMessage = null;
message.editing = true; message.editing = true;
message.channel.draft = message; message.channel.draft = message;
if (this.site.desktopView) {
this.focus({ refreshHeight: true, ensureAtEnd: true }); this.focus({ refreshHeight: true, ensureAtEnd: true });
} }
}
@action @action
async replyTo(message) { async replyTo(message) {

View File

@ -8,6 +8,7 @@ export default class ChatThreadComposer extends Service {
@service chat; @service chat;
@service capabilities; @service capabilities;
@service appEvents; @service appEvents;
@service site;
@tracked textarea; @tracked textarea;
@tracked scrollable; @tracked scrollable;
@ -43,8 +44,11 @@ export default class ChatThreadComposer extends Service {
this.chat.activeMessage = null; this.chat.activeMessage = null;
message.editing = true; message.editing = true;
message.thread.draft = message; message.thread.draft = message;
if (this.site.desktopView) {
this.focus({ refreshHeight: true, ensureAtEnd: true }); this.focus({ refreshHeight: true, ensureAtEnd: true });
} }
}
@action @action
replyTo() { replyTo() {