FIX: more consistent composer focus and replying indicator (#22443)

This commit is contained in:
Joffrey JAFFEUX 2023-07-05 22:24:53 +02:00 committed by GitHub
parent 2ce9364c08
commit 972e0f74ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 6 deletions

View File

@ -132,6 +132,8 @@ export default class ChatLivePane extends Component {
this.resetComposerMessage();
}
this.composer.focus();
this.loadMessages();
}

View File

@ -65,7 +65,6 @@
{{on "focusin" (fn this.computeIsFocused true)}}
{{on "focusout" (fn this.computeIsFocused false)}}
{{did-insert this.setupAutocomplete}}
{{did-insert this.composer.focus}}
data-chat-composer-context={{this.context}}
/>
</div>

View File

@ -44,10 +44,6 @@ export default class ChatComposer extends Component {
@tracked inProgressUploadsCount = 0;
@tracked presenceChannelName;
get shouldRenderReplyingIndicator() {
return this.args.channel;
}
get shouldRenderMessageDetails() {
return (
this.currentMessage?.editing ||

View File

@ -45,6 +45,7 @@ export default class ChatThreadPanel extends Component {
@action
didUpdateThread() {
this.subscribeToUpdates();
this.chatThreadComposer.focus();
this.loadMessages();
this.resetComposerMessage();
}

View File

@ -14,6 +14,10 @@ export default class ChatComposerChannel extends ChatComposer {
composerId = "channel-composer";
get shouldRenderReplyingIndicator() {
return this.args.channel;
}
get presenceChannelName() {
const channel = this.args.channel;
return `/chat-reply/${channel.id}`;

View File

@ -18,6 +18,10 @@ export default class ChatComposerThread extends ChatComposer {
this.composer.reset(this.args.thread);
}
get shouldRenderReplyingIndicator() {
return this.args.thread;
}
get disabled() {
return (
!this.chat.userCanInteractWithChat ||

View File

@ -15,7 +15,7 @@ export default class ChatChannelComposer extends Service {
@action
focus(options = {}) {
this.textarea.focus(options);
this.textarea?.focus(options);
}
@action