-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/public/script.js b/public/script.js
index ec3cbc3c7..38b46b362 100644
--- a/public/script.js
+++ b/public/script.js
@@ -131,6 +131,7 @@ import {
isDigitsOnly,
PAGINATION_TEMPLATE,
waitUntilCondition,
+ resetScrollHeight,
} from "./scripts/utils.js";
import { extension_settings, getContext, loadExtensionSettings, processExtensionHelpers, registerExtensionHelper, runGenerationInterceptors, saveMetadataDebounced } from "./scripts/extensions.js";
@@ -8623,6 +8624,10 @@ $(document).ready(function () {
});
}
+ // Set the height of "autoSetHeight" textareas within the drawer to their scroll height
+ $(this).closest('.drawer').find('.drawer-content textarea.autoSetHeight').each(function() {
+ resetScrollHeight($(this));
+ });
} else if (drawerWasOpenAlready) { //to close manually
icon.toggleClass('closedIcon openIcon');
@@ -8689,6 +8694,11 @@ $(document).ready(function () {
icon.toggleClass('down up');
icon.toggleClass('fa-circle-chevron-down fa-circle-chevron-up');
$(this).closest('.inline-drawer').find('.inline-drawer-content').stop().slideToggle();
+
+ // Set the height of "autoSetHeight" textareas within the inline-drawer to their scroll height
+ $(this).closest('.inline-drawer').find('.inline-drawer-content textarea.autoSetHeight').each(function() {
+ resetScrollHeight($(this));
+ });
});
$(document).on('click', '.mes .avatar', function () {
diff --git a/public/scripts/instruct-mode.js b/public/scripts/instruct-mode.js
index 2ee82bb70..11a95b103 100644
--- a/public/scripts/instruct-mode.js
+++ b/public/scripts/instruct-mode.js
@@ -6,6 +6,7 @@ import {
power_user,
context_presets,
} from "./power-user.js";
+import { resetScrollHeight } from "./utils.js";
/**
* @type {any[]} Instruct mode presets.
@@ -55,6 +56,9 @@ export function loadInstructMode(data) {
$element.on('input', function () {
power_user.instruct[control.property] = control.isCheckbox ? !!$(this).prop('checked') : $(this).val();
saveSettingsDebounced();
+ if (!control.isCheckbox) {
+ resetScrollHeight($element);
+ }
});
});
diff --git a/public/scripts/power-user.js b/public/scripts/power-user.js
index b50d2aef2..17e92decc 100644
--- a/public/scripts/power-user.js
+++ b/public/scripts/power-user.js
@@ -29,7 +29,7 @@ import {
import { registerSlashCommand } from "./slash-commands.js";
import { tokenizers } from "./tokenizers.js";
-import { delay } from "./utils.js";
+import { delay, resetScrollHeight } from "./utils.js";
export {
loadPowerUserSettings,
@@ -906,6 +906,9 @@ function loadContextSettings() {
$element.on('input', function () {
power_user.context[control.property] = control.isCheckbox ? !!$(this).prop('checked') : $(this).val();
saveSettingsDebounced();
+ if (!control.isCheckbox) {
+ resetScrollHeight($element);
+ }
});
});