click elsewhere to close edit message window

This commit is contained in:
2023-07-27 10:42:17 +08:00
parent c84be818e9
commit 196e12a4fd

View File

@@ -110,10 +110,15 @@ export default function Message(props: Props) {
className={
"absolute bg-black bg-opacity-50 w-full h-full top-0 left-0 pt-5 px-5 pb-20 rounded z-10"
}
onClick={() => setShowEdit(false)}
>
<div className="w-full h-full z-20">
<textarea
className={"relative w-full h-full"}
className={"w-full h-full"}
value={chat.content}
onClick={(event: any) => {
event.stopPropagation();
}}
onChange={(event: any) => {
chat.content = event.target.value;
chat.token = calculate_token_length(chat.content);
@@ -131,6 +136,7 @@ export default function Message(props: Props) {
</button>
</div>
</div>
</div>
)}
{showCopiedHint && <CopiedHint />}
{chatStore.develop_mode && (