Fix unfocusing tag input when switching characters

This commit is contained in:
Cohee 2024-03-16 23:35:41 +02:00
parent a789c6f76f
commit ad450981c0

View File

@ -5351,9 +5351,12 @@ async function getChat() {
await getChatResult();
eventSource.emit('chatLoaded', { detail: { id: this_chid, character: characters[this_chid] } });
// Focus on the textarea if not already focused on a visible text input
setTimeout(function () {
$('#send_textarea').click();
$('#send_textarea').focus();
if ($(document.activeElement).is('input:visible, textarea:visible')) {
return;
}
$('#send_textarea').trigger('click').trigger('focus');
}, 200);
} catch (error) {
await getChatResult();