I'm submitting a ...
[x] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summaryform.setFieldValue() does not trigger mask.updateValue(), which means value will be reset to the previously inputted by user as soon as rerender triggers. Warning
Element value was changed outside of mask. Syncronize mask using mask.updateValue() to work properly. will be displayed in console, indicating that mask.updateValue is required.
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
Consider following component. forceRerender is only for testing purposes to manually trigger component rerender.
I'm submitting a ... [x] bug report [ ] feature request [ ] question about the decisions made in the repository [ ] question about how to use this project
Summary
form.setFieldValue()
does not triggermask.updateValue()
, which means value will be reset to the previously inputted by user as soon as rerender triggers. WarningElement value was changed outside of mask. Syncronize mask using mask.updateValue() to work properly.
will be displayed in console, indicating thatmask.updateValue
is required.Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
Consider following component.
forceRerender
is only for testing purposes to manually trigger component rerender.Steps to reproduce:
Expected outcome: Input value is 1234 as that's what
form
containsActual outcome: Input value is whatever user typed on step 1.
Package versions: react: 17.0.2 antd: 4.23.5 antd-mask-input: 2.0.7