MCPcopy Create free account
hub / github.com/dailydotdev/apps / onInput

Function onInput

packages/shared/src/hooks/useInputFieldFunctions.ts:58–73  ·  view source on GitHub ↗
(event: SyntheticEvent<T, InputEvent>)

Source from the content-addressed store, hash-verified

56 }, [inputRef]);
57
58 const onInput = (event: SyntheticEvent<T, InputEvent>): void => {
59 clearIdleTimeout();
60 baseOnInput(event);
61 if (valueChanged) {
62 valueChanged(event.currentTarget.value);
63 }
64 const len = event.currentTarget.value.length;
65 setInputLength(len);
66 const inputValidity = inputRef.current?.checkValidity();
67
68 if (inputValidity) {
69 setValidInput(true);
70 } else {
71 idleTimeout();
72 }
73 };
74
75 useEffect(() => {
76 if (validInput !== undefined) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected