Skip to content

Commit fb28ba5

Browse files
committed
docs(webapp): document controlled-mode sync trade-off in SearchInput
1 parent c28f73d commit fb28ba5

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

apps/webapp/app/components/primitives/SearchInput.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ export function SearchInput({
4848
const [isFocused, setIsFocused] = useState(false);
4949

5050
// Compare against a ref, not `text`, so the effect stays off the keystroke path.
51+
// Trade-off: controlled mode assumes the parent accepts onValueChange; it won't
52+
// re-sync `text` if the parent rejects a change and holds `value` unchanged.
5153
const lastSyncedRef = useRef(initialSearch);
5254

5355
useEffect(() => {

0 commit comments

Comments
 (0)