click elsewhere to close edit message window
This commit is contained in:
@@ -110,25 +110,31 @@ export default function Message(props: Props) {
|
|||||||
className={
|
className={
|
||||||
"absolute bg-black bg-opacity-50 w-full h-full top-0 left-0 pt-5 px-5 pb-20 rounded z-10"
|
"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)}
|
||||||
>
|
>
|
||||||
<textarea
|
<div className="w-full h-full z-20">
|
||||||
className={"relative w-full h-full"}
|
<textarea
|
||||||
value={chat.content}
|
className={"w-full h-full"}
|
||||||
onChange={(event: any) => {
|
value={chat.content}
|
||||||
chat.content = event.target.value;
|
onClick={(event: any) => {
|
||||||
chat.token = calculate_token_length(chat.content);
|
event.stopPropagation();
|
||||||
setChatStore({ ...chatStore });
|
|
||||||
}}
|
|
||||||
></textarea>
|
|
||||||
<div className={"w-full flex justify-center"}>
|
|
||||||
<button
|
|
||||||
className={"m-2 p-1 rounded bg-green-500"}
|
|
||||||
onClick={() => {
|
|
||||||
setShowEdit(false);
|
|
||||||
}}
|
}}
|
||||||
>
|
onChange={(event: any) => {
|
||||||
Close
|
chat.content = event.target.value;
|
||||||
</button>
|
chat.token = calculate_token_length(chat.content);
|
||||||
|
setChatStore({ ...chatStore });
|
||||||
|
}}
|
||||||
|
></textarea>
|
||||||
|
<div className={"w-full flex justify-center"}>
|
||||||
|
<button
|
||||||
|
className={"m-2 p-1 rounded bg-green-500"}
|
||||||
|
onClick={() => {
|
||||||
|
setShowEdit(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Close
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user