@radix-ui__react-collapsible@1.1.12.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. diff --git a/dist/index.mjs b/dist/index.mjs
  2. --- a/dist/index.mjs
  3. +++ b/dist/index.mjs
  4. @@ -103,6 +103,12 @@
  5. useLayoutEffect(() => {
  6. const node = ref.current;
  7. if (node) {
  8. + // 隐藏详情没有可测量的尺寸;逐个写样式再读几何会在批量挂载时反复刷新样式。
  9. + // 保留 presence 状态推进,展开和收起动画中的可见节点仍走原测量流程。
  10. + if (node.hidden) {
  11. + setIsPresent(present);
  12. + return;
  13. + }
  14. originalStylesRef.current = originalStylesRef.current || {
  15. transitionDuration: node.style.transitionDuration,
  16. animationName: node.style.animationName
  17. diff --git a/dist/index.js b/dist/index.js
  18. --- a/dist/index.js
  19. +++ b/dist/index.js
  20. @@ -144,6 +144,12 @@
  21. (0, import_react_use_layout_effect.useLayoutEffect)(() => {
  22. const node = ref.current;
  23. if (node) {
  24. + // 隐藏详情没有可测量的尺寸;逐个写样式再读几何会在批量挂载时反复刷新样式。
  25. + // 保留 presence 状态推进,展开和收起动画中的可见节点仍走原测量流程。
  26. + if (node.hidden) {
  27. + setIsPresent(present);
  28. + return;
  29. + }
  30. originalStylesRef.current = originalStylesRef.current || {
  31. transitionDuration: node.style.transitionDuration,
  32. animationName: node.style.animationName