[GH-ISSUE #726] Input value doesn't change (react) #196

Open
opened 2026-03-02 23:45:12 +03:00 by kerem · 1 comment
Owner

Originally created by @loeclos on GitHub (Feb 22, 2026).
Original GitHub issue: https://github.com/anomalyco/opentui/issues/726

Originally assigned to: @msmps on GitHub.

I implement the input component like:

<input value={value} onChange={setValue}>

but when I try to clear the value with:

setValue('');

the input doesn't update.

Originally created by @loeclos on GitHub (Feb 22, 2026). Original GitHub issue: https://github.com/anomalyco/opentui/issues/726 Originally assigned to: @msmps on GitHub. I implement the input component like: ```tsx <input value={value} onChange={setValue}> ``` but when I try to clear the value with: ```tsx setValue(''); ``` the input doesn't update.
Author
Owner

@loeclos commented on GitHub (Feb 22, 2026):

Workaround would be accessing the input through a ref:

<input ref={inputRef}>

and to set the value:

inputRef.current.value = '';
<!-- gh-comment-id:3940133767 --> @loeclos commented on GitHub (Feb 22, 2026): Workaround would be accessing the input through a ref: ```tsx <input ref={inputRef}> ``` and to set the value: ```ts inputRef.current.value = ''; ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#196
No description provided.