Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Top padding for preventOverflow not respected in macOS Safari & iOS #422

Open
goleary opened this issue May 28, 2021 · 2 comments
Open

Top padding for preventOverflow not respected in macOS Safari & iOS #422

goleary opened this issue May 28, 2021 · 2 comments

Comments

@goleary
Copy link

goleary commented May 28, 2021

I have a popper controlled tooltip and I'm trying to create add top padding (50px in this example) to the overflow prevention.

Here you can see even though I've turned on the altAxis overflow prevention.
image

this is the config I'm using

  const { styles, attributes } = usePopper(range, popperElement, {
    placement: 'top',
    modifiers: [
      {
        name: 'preventOverflow',
        options: {
          // TODO: figure out why top padding isn't being respected
          altAxis: true,
          padding: {
            top: 50,
            left: 8,
            right: 8,
            bottom: 8,
          },
        },
      },
    ],
  });

Reproduction demo

https://stackblitz.com/edit/react-popper-overflow?file=Tooltip.tsx

What is the expected behavior?

I'd like the tooltip to respect the top padding as specified in options.

What went wrong?

Top padding not respected.

I know the option is working because the "main" axis padding is respected.

Packages versions

  • Popper.js: 2.9.2
  • react-popper: 2.2.5
@goleary
Copy link
Author

goleary commented May 28, 2021

I did a bit more playing around and this bug seems to be environment/browser dependent.

You can see for yourself by using this link (live version of the provide minimal repro above), selecting text & scrolling down until the tooltip should flip.

No issue

  • Windows Chrome
  • macOS Chrome

Issue Present

  • macOS Safari
  • iOS (chrome & safari).

@goleary goleary changed the title Top padding for preventOverflow not respected Top padding for preventOverflow not respected in macOS Safari & iOS Jun 2, 2021
@acgblogs
Copy link

thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants