Spaces:
Sleeping
Sleeping
drakosfire
commited on
Commit
•
cd4a8f3
1
Parent(s):
0f83dcd
added check to adjustTextareaHeight for single line and prevent setting auto
Browse files- storeUI.html +13 -5
storeUI.html
CHANGED
@@ -426,9 +426,9 @@ div[contenteditable="true"] p::first-letter {
|
|
426 |
.string-action-description-textarea {
|
427 |
width: 100%;
|
428 |
height:16px;
|
429 |
-
font-size:
|
430 |
font-weight: 400;
|
431 |
-
line-height:
|
432 |
margin-bottom: 0;
|
433 |
box-sizing: border-box;
|
434 |
border: 0;
|
@@ -684,8 +684,11 @@ div[contenteditable="true"] p::first-letter {
|
|
684 |
storeInitialPositions();
|
685 |
|
686 |
function adjustTextareaHeight(el) {
|
687 |
-
el.
|
688 |
-
|
|
|
|
|
|
|
689 |
}
|
690 |
|
691 |
function initializeTextareaResizing() {
|
@@ -701,7 +704,12 @@ div[contenteditable="true"] p::first-letter {
|
|
701 |
classes.forEach(className => {
|
702 |
const textareas = document.querySelectorAll(`.${className}`);
|
703 |
console.log(`Textareas found for ${className}:`, textareas.length); // Debugging line
|
704 |
-
textareas.forEach(textarea => {
|
|
|
|
|
|
|
|
|
|
|
705 |
// Adjust height on page load
|
706 |
adjustTextareaHeight(textarea);
|
707 |
// Adjust height on input
|
|
|
426 |
.string-action-description-textarea {
|
427 |
width: 100%;
|
428 |
height:16px;
|
429 |
+
font-size: 14px;
|
430 |
font-weight: 400;
|
431 |
+
line-height: 16px;
|
432 |
margin-bottom: 0;
|
433 |
box-sizing: border-box;
|
434 |
border: 0;
|
|
|
684 |
storeInitialPositions();
|
685 |
|
686 |
function adjustTextareaHeight(el) {
|
687 |
+
if (el.scrollHeight > 16){
|
688 |
+
el.style.height = 'auto';
|
689 |
+
el.style.height = (el.scrollHeight) + 'px';
|
690 |
+
}
|
691 |
+
console.log('Original height:', el.style.height);
|
692 |
}
|
693 |
|
694 |
function initializeTextareaResizing() {
|
|
|
704 |
classes.forEach(className => {
|
705 |
const textareas = document.querySelectorAll(`.${className}`);
|
706 |
console.log(`Textareas found for ${className}:`, textareas.length); // Debugging line
|
707 |
+
textareas.forEach(textarea => {
|
708 |
+
console.log('scrollHeight:', textarea.scrollHeight);
|
709 |
+
console.log('clientHeight:', textarea.clientHeight);
|
710 |
+
console.log('offsetHeight:', textarea.offsetHeight);
|
711 |
+
console.log('Computed line-height:', window.getComputedStyle(textarea).lineHeight);
|
712 |
+
|
713 |
// Adjust height on page load
|
714 |
adjustTextareaHeight(textarea);
|
715 |
// Adjust height on input
|