Skip to content

Commit

Permalink
Update textarea_controller.js
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielVajnagi authored Dec 3, 2024
1 parent 2a74483 commit 7877a05
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/javascript/controllers/textarea_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ export default class extends Controller {
}

resize(textarea) {
textarea.style.overflow = "hidden"; // Prevent scrollbars
textarea.style.resize = "none"; // Prevent manual resizing
textarea.style.height = "auto"; // Reset height
textarea.style.overflow = "hidden";
textarea.style.resize = "none";
textarea.style.height = "auto";
textarea.style.height = `${textarea.scrollHeight}px`; // Adjust height based on scrollHeight
}

Expand Down

0 comments on commit 7877a05

Please sign in to comment.