Skip to content

Commit

Permalink
Hindre refresh ved åpning i ny fane (#5136)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomashwi authored Oct 24, 2023
1 parent b235aab commit 704dd07
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ const ÅpneSakINyttVindu: React.FC<Omit<ButtonProps, 'children'> & ÅpneSakINytt
const { pathname } = useLocation();
const href = useHref(pathname);

const handleClick = () => {
const handleClick = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
e.preventDefault();
if (pathname.length > 0) {
window.open(overridePath || href, target);
}
Expand All @@ -34,7 +35,7 @@ const ÅpneSakINyttVindu: React.FC<Omit<ButtonProps, 'children'> & ÅpneSakINytt
return (
<Button
variant={variant}
onClick={handleClick}
onClick={e => handleClick(e)}
icon={icon}
size={size}
iconPosition={iconPosition}
Expand Down

0 comments on commit 704dd07

Please sign in to comment.