Skip to content

Commit

Permalink
add a hacky solution to fix textarea height
Browse files Browse the repository at this point in the history
  • Loading branch information
Pawan Kumar authored and Pawan Kumar committed May 31, 2024
1 parent 1086cdb commit ddd5571
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ function TextArea(props: TextAreaProps, ref: TextAreaRef) {
input.style.alignSelf = "start";
input.style.height = "auto";
// offsetHeight - clientHeight accounts for the border/padding.
// Also, adding 1px to fix a bug in browser where there is a scrolllbar on certain heights
input.style.height = `${
input.scrollHeight + (input.offsetHeight - input.clientHeight)
input.scrollHeight + (input.offsetHeight - input.clientHeight) + 1
}px`;
input.style.overflow = prevOverflow;
input.style.alignSelf = prevAlignment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
text-overflow: ellipsis;
max-inline-size: 100%;
width: 100%;
box-sizing: content-box;
box-sizing: border-box;
block-size: calc(
var(--body-line-height) + var(--body-margin-start) +
var(--body-margin-end)
Expand Down

0 comments on commit ddd5571

Please sign in to comment.