fix: fixed the input flickering after form.resetFields #37352
fix this issues#37352
Reason:
-
when
form.resetFieldsis called, therefreshmethod of thefieldcomponent is triggered, which changes theresetCount.(code) -
resetCountis used as thekeyof the subcomponent, causing the subcomponent to be recreated.(code) -
and the
React.useEffectused by picker to assign value to input; (code)
So there will be flickering
demo: link
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Updated |
|---|---|---|---|
| picker | ✅ Ready (Inspect) | Visit Preview | Sep 13, 2022 at 9:16AM (UTC) |
Codecov Report
Merging #473 (9933ce7) into master (7492e10) will not change coverage. The diff coverage is
100.00%.
:exclamation: Current head 9933ce7 differs from pull request most recent head f81df80. Consider uploading reports for the commit f81df80 to get more accurate results
@@ Coverage Diff @@
## master #473 +/- ##
=======================================
Coverage 99.53% 99.53%
=======================================
Files 46 46
Lines 2149 2149
Branches 634 641 +7
=======================================
Hits 2139 2139
Misses 8 8
Partials 2 2
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/hooks/useTextValueMapping.ts | 100.00% <100.00%> (ø) |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more