pb-sxp-ui 1.15.38 → 1.15.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,10 +16,12 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
16
16
  if (!realRef.current || !clampRef.current || !isPost || !text || isShowMore)
17
17
  return;
18
18
  requestAnimationFrame(() => {
19
+ realRef.current.style.position = 'relative';
19
20
  const realHeight = realRef.current.getBoundingClientRect().height;
20
21
  const clampHeight = clampRef.current.getBoundingClientRect().height;
21
22
  const isActuallyClamped = realHeight > clampHeight + 1;
22
23
  setIsShow(isActuallyClamped);
24
+ realRef.current.style.position = 'absolute';
23
25
  });
24
26
  }, [isPost, text, isShowMore]);
25
27
  useEffect(() => {
@@ -53,8 +55,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
53
55
  visibility: 'hidden',
54
56
  opacity: 0,
55
57
  clipPath: 'inset(100%)',
56
- transform: 'translateX(-9999px)',
57
- position: 'absolute'
58
+ transform: 'translateX(-9999px)'
58
59
  }, dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), textStyle) } }),
59
60
  text && isPost && isShow && (React.createElement("button", { "aria-label": isShowMore ? unfoldText || 'show less' : foldText || 'show more', style: { textDecoration: 'underline', cursor: 'pointer' }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick, dangerouslySetInnerHTML: {
60
61
  __html: setFontForText(isShowMore ? unfoldText || 'show less' : foldText || 'show more', textStyle)
@@ -18,10 +18,12 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
18
18
  if (!realRef.current || !clampRef.current || !isPost || !text || isShowMore)
19
19
  return;
20
20
  requestAnimationFrame(() => {
21
+ realRef.current.style.position = 'relative';
21
22
  const realHeight = realRef.current.getBoundingClientRect().height;
22
23
  const clampHeight = clampRef.current.getBoundingClientRect().height;
23
24
  const isActuallyClamped = realHeight > clampHeight + 1;
24
25
  setIsShow(isActuallyClamped);
26
+ realRef.current.style.position = 'absolute';
25
27
  });
26
28
  }, [isPost, text, isShowMore]);
27
29
  (0, react_1.useEffect)(() => {
@@ -55,8 +57,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
55
57
  visibility: 'hidden',
56
58
  opacity: 0,
57
59
  clipPath: 'inset(100%)',
58
- transform: 'translateX(-9999px)',
59
- position: 'absolute'
60
+ transform: 'translateX(-9999px)'
60
61
  }, dangerouslySetInnerHTML: { __html: (0, tool_1.setFontForText)(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), textStyle) } }),
61
62
  text && isPost && isShow && (react_1.default.createElement("button", { "aria-label": isShowMore ? unfoldText || 'show less' : foldText || 'show more', style: { textDecoration: 'underline', cursor: 'pointer' }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick, dangerouslySetInnerHTML: {
62
63
  __html: (0, tool_1.setFontForText)(isShowMore ? unfoldText || 'show less' : foldText || 'show more', textStyle)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.15.38",
3
+ "version": "1.15.39",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",