fix: ctrl+enter trigger auto hegiht
This commit is contained in:
@@ -840,6 +840,8 @@ export default function ChatBOX(props: {
|
|||||||
if (event.ctrlKey && event.code === "Enter") {
|
if (event.ctrlKey && event.code === "Enter") {
|
||||||
send(event.target.value, true);
|
send(event.target.value, true);
|
||||||
setInputMsg("");
|
setInputMsg("");
|
||||||
|
event.target.value = "";
|
||||||
|
autoHeight(event);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
autoHeight(event);
|
autoHeight(event);
|
||||||
|
|||||||
@@ -5,4 +5,5 @@ export const autoHeight = (event: any) => {
|
|||||||
event.target.scrollHeight,
|
event.target.scrollHeight,
|
||||||
window.innerHeight * 0.7
|
window.innerHeight * 0.7
|
||||||
)}px`;
|
)}px`;
|
||||||
|
console.log("set auto height", event.target.style.height);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user