Skip to content

Commit

Permalink
fix: Fix layout shift when first render popper (#848)
Browse files Browse the repository at this point in the history
Closes #819
  • Loading branch information
haodt committed Mar 1, 2021
1 parent 47baf00 commit 37b0079
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test("markup", () => {
hidden=""
id="id-1"
role="tooltip"
style="display: none; pointer-events: none;"
style="display: none; position: fixed; left: 0px; top: 0px; pointer-events: none;"
>
Tooltip
</div>
Expand Down
6 changes: 5 additions & 1 deletion packages/reakit/src/Popover/PopoverState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ export function usePopoverState(
const [placement, setPlacement] = React.useState(sealedPlacement);
const [offset] = React.useState(sealedOffset || [0, gutter]);
const [popoverStyles, setPopoverStyles] = React.useState<React.CSSProperties>(
{}
{
position: "fixed",
left: "0",
top: "0",
}
);
const [arrowStyles, setArrowStyles] = React.useState<React.CSSProperties>({});

Expand Down

0 comments on commit 37b0079

Please sign in to comment.