mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix unfocusing tag input when switching characters
This commit is contained in:
@@ -5351,9 +5351,12 @@ async function getChat() {
|
|||||||
await getChatResult();
|
await getChatResult();
|
||||||
eventSource.emit('chatLoaded', { detail: { id: this_chid, character: characters[this_chid] } });
|
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 () {
|
setTimeout(function () {
|
||||||
$('#send_textarea').click();
|
if ($(document.activeElement).is('input:visible, textarea:visible')) {
|
||||||
$('#send_textarea').focus();
|
return;
|
||||||
|
}
|
||||||
|
$('#send_textarea').trigger('click').trigger('focus');
|
||||||
}, 200);
|
}, 200);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
await getChatResult();
|
await getChatResult();
|
||||||
|
Reference in New Issue
Block a user