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 capabilities;
@service appEvents;
@service site;
@tracked textarea;
@tracked scrollable;
@ -48,7 +49,10 @@ export default class ChatChannelComposer extends Service {
this.chat.activeMessage = null;
message.editing = true;
message.channel.draft = message;
this.focus({ refreshHeight: true, ensureAtEnd: true });
if (this.site.desktopView) {
this.focus({ refreshHeight: true, ensureAtEnd: true });
}
}
@action

View File

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