fix: auto hegiht for textarea
This commit is contained in:
8
src/textarea.tsx
Normal file
8
src/textarea.tsx
Normal file
@@ -0,0 +1,8 @@
|
||||
export const autoHeight = (event: any) => {
|
||||
event.target.style.height = "auto";
|
||||
// max 70% of screen height
|
||||
event.target.style.height = `${Math.min(
|
||||
event.target.scrollHeight,
|
||||
window.innerHeight * 0.7
|
||||
)}px`;
|
||||
};
|
||||
Reference in New Issue
Block a user