fix(chat): keep mobile send from losing focus
This commit is contained in:
@@ -51,6 +51,7 @@ interface KeyboardSnapshot {
|
||||
|
||||
export function useKeyboardHeight({
|
||||
targetRef,
|
||||
containerRef,
|
||||
active = false,
|
||||
onKeyboardDismiss,
|
||||
}: UseKeyboardHeightOptions = {}): void {
|
||||
@@ -172,6 +173,13 @@ export function useKeyboardHeight({
|
||||
|
||||
const handlePointerDown = (event: PointerEvent | TouchEvent) => {
|
||||
const target = targetRef?.current;
|
||||
const container = containerRef?.current;
|
||||
if (event.target instanceof Node && container?.contains(event.target)) {
|
||||
log.important("info", "[keyboard] keep active for input container tap", {
|
||||
snapshot: formatSnapshot(readKeyboardSnapshot()),
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!target || event.target === target) return;
|
||||
if (event.target instanceof Node && target.contains(event.target)) return;
|
||||
release("outside-interaction");
|
||||
@@ -215,6 +223,7 @@ export function useKeyboardHeight({
|
||||
};
|
||||
}, [
|
||||
active,
|
||||
containerRef,
|
||||
targetRef,
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user