Fix focusing on topic when using ctx menu Edit Topic action

This commit is contained in:
Max Leiter 2022-05-31 20:47:50 -07:00
parent 73014369c4
commit 5b4166ff30
No known key found for this signature in database
GPG key ID: A3512F2F2F17EBDA
3 changed files with 11 additions and 10 deletions

View file

@ -236,14 +236,16 @@ export default defineComponent({
}
);
const editTopicRef = ref(props.channel.editTopic);
watch(editTopicRef, (newTopic) => {
if (newTopic) {
void nextTick(() => {
topicInput.value?.focus();
});
watch(
() => props.channel.editTopic,
(newTopic) => {
if (newTopic) {
void nextTick(() => {
topicInput.value?.focus();
});
}
}
});
);
onMounted(() => {
channelChanged();
@ -260,7 +262,6 @@ export default defineComponent({
messageList,
topicInput,
specialComponent,
editTopicRef,
hideUserVisibleError,
editTopic,
saveTopic,

View file

@ -6,7 +6,7 @@
<i class="account"> [{{ message.account }}]</i>
</template>
<template v-if="message.gecos">
<i class="realname"> {{ message.gecos }} </i>
<i class="realname"> {{ message.gecos }}</i>
</template>
has joined the channel
</span>

View file

@ -2,7 +2,7 @@ import socket from "../socket";
import {store} from "../store";
import {switchToChannel} from "../router";
function input(args) {
function input(args: string[]) {
if (args.length > 0) {
let channels = args[0];