mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 22:36:31 +08:00
fix: Anchor - The replace attribute causes no scrolling animation (#49136)
Co-authored-by: dengxia <dengxia@tanqingsk.com>
This commit is contained in:
parent
72791d16f3
commit
a59081ea55
@ -42,12 +42,12 @@ const AnchorLink: React.FC<AnchorLinkProps> = (props) => {
|
||||
}, [href]);
|
||||
|
||||
const handleClick = (e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {
|
||||
onClick?.(e, { title, href });
|
||||
scrollTo?.(href);
|
||||
if (replace) {
|
||||
e.preventDefault();
|
||||
window.location.replace(href);
|
||||
}
|
||||
onClick?.(e, { title, href });
|
||||
scrollTo?.(href);
|
||||
};
|
||||
|
||||
// =================== Warning =====================
|
||||
|
Loading…
Reference in New Issue
Block a user