fix(chat): improve in-app keyboard avoidance
This commit is contained in:
@@ -3,6 +3,7 @@ import { useRef, useState } from "react";
|
||||
|
||||
import { useChatDispatch } from "@/stores/chat/chat-context";
|
||||
import { useUserState } from "@/stores/user/user-context";
|
||||
import { useKeyboardHeight } from "@/hooks";
|
||||
import { Logger } from "@/utils";
|
||||
|
||||
import { ChatInputActionPanel } from "./chat-input-action-panel";
|
||||
@@ -28,6 +29,11 @@ export function ChatInputBar({ disabled = false }: ChatInputBarProps) {
|
||||
const isActive = isFocused || isActionPanelOpen;
|
||||
const voiceMinutesRemaining = currentUser?.voiceMinutesRemaining ?? 0;
|
||||
|
||||
useKeyboardHeight({
|
||||
targetRef: textareaRef,
|
||||
active: isFocused,
|
||||
});
|
||||
|
||||
const handleInputChange = (value: string) => {
|
||||
setInput(value);
|
||||
if (value.trim().length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user