Skip to content

Commit 73567d8

Browse files
committed
fix(textarea-autoresize): add a bit of padding when setting textarea height
1 parent 6abcb16 commit 73567d8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

js/text-area/textarea-autoresize.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function update_height(target: HTMLTextAreaElement) {
4949
if (target.scrollHeight > 0) {
5050
// Automatically resize the textarea to fit its content.
5151
target.style.height = "auto";
52-
target.style.height = target.scrollHeight + "px";
52+
target.style.height = target.scrollHeight + 2 + "px";
5353
} else {
5454
// The textarea is not visible on the page, therefore it has a 0 scroll height.
5555

shiny/www/py-shiny/text-area/textarea-autoresize.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function callUpdateHeightWhenTargetIsVisible(target) {
2727
function update_height(target) {
2828
if (target.scrollHeight > 0) {
2929
target.style.height = "auto";
30-
target.style.height = target.scrollHeight + "px";
30+
target.style.height = target.scrollHeight + 2 + "px";
3131
} else {
3232
callUpdateHeightWhenTargetIsVisible(target);
3333
}

0 commit comments

Comments
 (0)