fix: ctrl+enter trigger auto hegiht

This commit is contained in:
2024-01-16 10:21:41 +08:00
parent 67a8140a01
commit b6ae82aa9c
2 changed files with 3 additions and 0 deletions

View File

@@ -840,6 +840,8 @@ export default function ChatBOX(props: {
if (event.ctrlKey && event.code === "Enter") {
send(event.target.value, true);
setInputMsg("");
event.target.value = "";
autoHeight(event);
return;
}
autoHeight(event);

View File

@@ -5,4 +5,5 @@ export const autoHeight = (event: any) => {
event.target.scrollHeight,
window.innerHeight * 0.7
)}px`;
console.log("set auto height", event.target.style.height);
};