picker icon indicating copy to clipboard operation
picker copied to clipboard

fix: fixed the input flickering after form.resetFields #37352

Open QiuShuiBai opened this issue 3 years ago • 2 comments

fix this issues#37352

Reason:

  • when form.resetFields is called, the refresh method of the field component is triggered, which changes the resetCount.(code)

  • resetCount is used as the key of the subcomponent, causing the subcomponent to be recreated.(code)

  • and the React.useEffect used by picker to assign value to input; (code)

So there will be flickering

demo: link

QiuShuiBai avatar Sep 13 '22 09:09 QiuShuiBai

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)

vercel[bot] avatar Sep 13 '22 09:09 vercel[bot]

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

codecov[bot] avatar Sep 13 '22 09:09 codecov[bot]