mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 12:39:49 +08:00
fix: Typography dead loop (#50688)
This commit is contained in:
parent
afabec60c3
commit
71533ff2a3
@ -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"]
|
||||
}
|
||||
|
@ -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(
|
||||
<Base ellipsis={{ tooltip: tooltipObj }} component="p">
|
||||
{fullStr}
|
||||
</Base>,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user