Skip to content

Commit

Permalink
Might not be the best way, but it works. getFloatingProps added it's …
Browse files Browse the repository at this point in the history
…own tabIndex="-1", which we need to get rid of.
  • Loading branch information
it-vegard committed Sep 20, 2023
1 parent e697e2f commit a524196
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions @navikt/core/react/src/popover/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,21 +203,24 @@ export const Popover = forwardRef<HTMLDivElement, PopoverProps>(
left: "right",
}[flPlacement.split("-")[0]];

const floatingProps = getFloatingProps({
ref: floatingRef,
style: {
position: strategy,
top: y ?? 0,
left: x ?? 0,
},
});
delete floatingProps.tabIndex;

return (
<div
className={cl("navds-popover", className, {
"navds-popover--hidden": !open || !anchorEl,
})}
data-placement={flPlacement}
aria-hidden={!open || !anchorEl}
{...getFloatingProps({
ref: floatingRef,
style: {
position: strategy,
top: y ?? 0,
left: x ?? 0,
},
})}
{...floatingProps}
{...rest}
>
{children}
Expand Down

0 comments on commit a524196

Please sign in to comment.