dialog icon indicating copy to clipboard operation
dialog copied to clipboard

fix: destroyOnClose fails with forceRender

Open HelloAny opened this issue 4 years ago • 5 comments

ant-design/ant-design#28847

解决destroyOnCloseforceRender都设置为truedestroyOnClose失效

原因:当forceRender设置为true时,判断是否删除子节点的语句失效

方案:为forceRender增加一层缓存,当第一次打开Modal时设置forceRenderfalse

此外,感觉antd文档里关于forceRender部分的描述不是很清晰,个人理解为首次未打开Modal可获取其中的dom image

觉得可以和dialog的文档稍作同步

HelloAny avatar Jan 15 '21 12:01 HelloAny

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/react-component/dialog/ookx04a0g
✅ Preview: https://dialog-git-fork-helloany-fix-destroyonclose.react-component.vercel.app

vercel[bot] avatar Jan 15 '21 12:01 vercel[bot]

Codecov Report

Merging #232 (8f7c630) into master (586bfcb) will increase coverage by 0.06%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #232      +/-   ##
==========================================
+ Coverage   98.10%   98.17%   +0.06%     
==========================================
  Files           6        6              
  Lines         158      164       +6     
  Branches       46       47       +1     
==========================================
+ Hits          155      161       +6     
  Misses          2        2              
  Partials        1        1              
Impacted Files Coverage Δ
src/DialogWrap.tsx 95.45% <100.00%> (+1.33%) :arrow_up:
src/Dialog/Content/index.tsx 95.23% <0.00%> (-0.12%) :arrow_down:
src/Dialog/index.tsx 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 586bfcb...8f7c630. Read the comment docs.

codecov[bot] avatar Jan 15 '21 12:01 codecov[bot]

3.x 也有这个问题。😳

yoyo837 avatar Jun 07 '21 10:06 yoyo837

冲突了

afc163 avatar Oct 29 '22 09:10 afc163

ping @HelloAny

afc163 avatar Nov 06 '22 09:11 afc163