Skip to content

Commit 1ca34b6

Browse files
committed
fix: fix shortenTextAfterLength props issue #52
1 parent d6592fb commit 1ca34b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/types/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ export const TypeString: FC<TypeProps> = ({ children = '', keyName }) => {
6060
const { shortenTextAfterLength: length = 30 } = useStore();
6161
const { as, render, ...reset } = Str;
6262
const childrenStr = children as string;
63-
const [shorten, setShorten] = useState(length && childrenStr.length >= length);
64-
useEffect(() => setShorten(length && childrenStr.length >= length), [length]);
63+
const [shorten, setShorten] = useState(length && childrenStr.length > length);
64+
useEffect(() => setShorten(length && childrenStr.length > length), [length]);
6565
const Comp = as || 'span';
6666
const style: React.CSSProperties = {
6767
...defalutStyle,

0 commit comments

Comments
 (0)