react-code-input icon indicating copy to clipboard operation
react-code-input copied to clipboard

Value prop changes are not reflected in the display

Open dainyl opened this issue 6 years ago • 6 comments

Currently the value prop only sets the initial value. However, I would like value to instead behave like it would for a standard input field, where changes in the value prop would be reflected in the display. In this manner it would be behaving similar to a standard React controlled component https://reactjs.org/docs/forms.html#controlled-components

dainyl avatar Jul 16 '18 04:07 dainyl

Hey folks, I opened a PR aiming to fix this.

Also took the opportunity to move from componentWillReceiveProps to getDerivedStateFromProps, to make the component future-proof. Feel free to give some feedback!

thmsmontana avatar Aug 17 '18 15:08 thmsmontana

@thmsmontana can you please fix tests and reopen PR? Thank you!

40818419 avatar Sep 02 '18 10:09 40818419

Any updates on this?

AntTargett avatar Sep 26 '18 03:09 AntTargett

Will this be fixed any time soon? 👀

tuucan avatar Jul 07 '20 16:07 tuucan

any updates?

sfalihi avatar Aug 02 '20 20:08 sfalihi

use key property,when key was changed then render immediately,such as: <ReactCodeInput fields={6} name="roomnum" inputMode="numeric" value={roomnum} key={roomnum}/>

little51 avatar Nov 08 '22 03:11 little51