fix(chat): keep mobile send from losing focus
This commit is contained in:
@@ -18,12 +18,14 @@ export interface ChatSendButtonProps {
|
||||
disabled: boolean;
|
||||
hasContent: boolean;
|
||||
onClick: () => void;
|
||||
onPointerDownSend: () => void;
|
||||
}
|
||||
|
||||
export function ChatSendButton({
|
||||
disabled,
|
||||
hasContent,
|
||||
onClick,
|
||||
onPointerDownSend,
|
||||
}: ChatSendButtonProps) {
|
||||
return (
|
||||
<button
|
||||
@@ -32,6 +34,13 @@ export function ChatSendButton({
|
||||
hasContent && !disabled ? styles.buttonActive : styles.buttonEmpty
|
||||
}`}
|
||||
disabled={disabled}
|
||||
onPointerDown={(event) => {
|
||||
if (event.pointerType === "mouse") return;
|
||||
if (disabled) return;
|
||||
event.preventDefault();
|
||||
if (!hasContent) return;
|
||||
onPointerDownSend();
|
||||
}}
|
||||
onClick={onClick}
|
||||
aria-label="Send message"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user