refactor(keyboard): remove unused keyboard watchdog functionality

This commit is contained in:
2026-07-01 11:48:59 +08:00
parent 9da57e9279
commit fd1a2bad3c
3 changed files with 0 additions and 197 deletions
-19
View File
@@ -34,7 +34,6 @@ import {
isKeyboardTargetActive,
} from "./keyboard-target";
import { addKeyboardRecheckListeners } from "./keyboard-event-listeners";
import { createKeyboardWatchdog } from "./keyboard-watchdog";
import { isPossibleKeyboardCloseEvent } from "./release-events";
import type { UseKeyboardHeightOptions, ViewportMetrics } from "./types";
import {
@@ -181,7 +180,6 @@ export function useKeyboardHeight({
metrics: formatMetrics(metrics),
});
}
watchdog.update("apply");
};
const schedule = () => {
@@ -234,24 +232,8 @@ export function useKeyboardHeight({
environment,
metrics: formatMetrics(metrics),
});
watchdog.stop(reason);
};
const watchdog = createKeyboardWatchdog({
environment,
log,
getTarget: () => targetRef?.current,
getReactActive: () => activeRef.current,
getFallbackAllowed: () => fallbackAllowedRef.current,
getFallbackWasApplied: () => fallbackWasApplied,
getLastInputLift: () => lastInputLift,
getFocusedAt: () => focusedAtRef.current,
onPossibleClose: () => {
lastEventType = "watchdog";
lastMayBeKeyboardClose = true;
},
schedule,
});
const removeKeyboardRecheckListeners =
addKeyboardRecheckListeners(scheduleRechecks);
@@ -259,7 +241,6 @@ export function useKeyboardHeight({
return () => {
if (rafId != null) window.cancelAnimationFrame(rafId);
watchdog.cleanup();
timeoutIds.forEach((id) => window.clearTimeout(id));
removeKeyboardRecheckListeners();
resetKeyboardVars();