Skip to content

Commit

Permalink
refactor: unneeded null protection
Browse files Browse the repository at this point in the history
  • Loading branch information
talkor committed Jan 5, 2025
1 parent b02effa commit 8bd33a0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ const EditableTypography: VibeComponent<EditableTypographyProps, HTMLElement> =
function resizeTextarea() {
if (inputRef.current) {
// Temporarily set the height to "auto" to accurately measure the scroll height of the content inside the textarea.
inputRef?.current?.style.setProperty("--input-height", "auto");
inputRef.current?.style.setProperty("--input-height", "auto");

requestAnimationFrame(() => {
const textarea = inputRef.current as HTMLTextAreaElement;
Expand All @@ -195,7 +195,7 @@ const EditableTypography: VibeComponent<EditableTypographyProps, HTMLElement> =
textarea.scrollHeight + textareaBorderBoxSizing.current,
textareaLineHeight.current + textareaBorderBoxSizing.current
);
inputRef?.current?.style.setProperty("--input-height", `${height}px`);
inputRef.current?.style.setProperty("--input-height", `${height}px`);
});
}
}
Expand Down

0 comments on commit 8bd33a0

Please sign in to comment.