Skip to content

Commit

Permalink
resize in the initial frame
Browse files Browse the repository at this point in the history
  • Loading branch information
mj12albert committed Nov 25, 2024
1 parent f407f28 commit ef2e707
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ const TextareaAutosize = React.forwardRef(function TextareaAutosize(
resizeObserver = new ResizeObserver(() => {
resizeObserver.unobserve(input);
cancelAnimationFrame(frameRef.current);
handleResize();
frameRef.current = requestAnimationFrame(() => {
resizeObserver.observe(input);
handleResize();
});
});
resizeObserver.observe(input);
Expand Down

0 comments on commit ef2e707

Please sign in to comment.