fix: send button auto height

This commit is contained in:
2024-01-16 17:55:46 +08:00
parent 0eabcc0d0a
commit a4d3091e06
3 changed files with 14 additions and 10 deletions

View File

@@ -1,9 +1,9 @@
export const autoHeight = (event: any) => {
event.target.style.height = "auto";
export const autoHeight = (target: any) => {
target.style.height = "auto";
// max 70% of screen height
event.target.style.height = `${Math.min(
event.target.scrollHeight,
target.style.height = `${Math.min(
target.scrollHeight,
window.innerHeight * 0.7
)}px`;
console.log("set auto height", event.target.style.height);
console.log("set auto height", target.style.height);
};