diff --git a/BUG_VERSIONS.json b/BUG_VERSIONS.json index 7542cbdc35..ca2a7aa428 100644 --- a/BUG_VERSIONS.json +++ b/BUG_VERSIONS.json @@ -56,5 +56,6 @@ ">= 5.16.0 <= 5.16.1": ["https://github.com/ant-design/ant-design/issues/48200"], "5.16.3": ["https://github.com/ant-design/ant-design/issues/48568"], "5.17.1": ["https://github.com/ant-design/ant-design/issues/48913"], - "5.18.2": ["https://github.com/ant-design/ant-design/pull/49487"] + "5.18.2": ["https://github.com/ant-design/ant-design/pull/49487"], + "5.20.4": ["https://github.com/ant-design/ant-design/issues/50687"] } diff --git a/components/typography/__tests__/ellipsis.test.tsx b/components/typography/__tests__/ellipsis.test.tsx index 5340e6f60e..6e92e29a20 100644 --- a/components/typography/__tests__/ellipsis.test.tsx +++ b/components/typography/__tests__/ellipsis.test.tsx @@ -633,4 +633,15 @@ describe('Typography.Ellipsis', () => { rerender(renderDemo(true)); expect(container.querySelector('.ant-typography-collapse')).toBeTruthy(); }); + + it('no dead loop', () => { + const tooltipObj: any = {}; + tooltipObj.loop = tooltipObj; + + render( + + {fullStr} + , + ); + }); }); diff --git a/components/typography/hooks/useTooltipProps.ts b/components/typography/hooks/useTooltipProps.ts index 8b83569e90..fe540585ba 100644 --- a/components/typography/hooks/useTooltipProps.ts +++ b/components/typography/hooks/useTooltipProps.ts @@ -17,6 +17,6 @@ const useTooltipProps = ( return { title: editConfigText ?? children, ...tooltip }; } return { title: tooltip }; - }, [typeof tooltip === 'object' ? JSON.stringify(tooltip) : tooltip, editConfigText, children]); + }, [tooltip, editConfigText, children]); export default useTooltipProps;