geist-org / geist-ui

A design system for building modern websites and applications.
https://geist-ui.dev
MIT License
4.33k stars 334 forks source link

Portal placement wrong when I scroll #435

Closed philmetzger closed 3 years ago

philmetzger commented 3 years ago

Bug report 🐞

Version & Environment

Expection

When I click on a button to show a portal dialog, it should point at the button

Actual results (or Errors)

When I scroll down the page, then click on a button to display a portal, then the modal is pointing at the wrong thing.

<Popover content={this.getEditPopoverContent()}>
    <Button iconRight={<Edit2/>} auto={true} size="mini" ghost={true} shadow={true}/>
</Popover>

Correct: image Incorrect (as soon as the page scroll changes): image

I am guessing the portal is globally rendered and not locally to the element it should be triggered from?

Is this a bug or have I done something wrong

unix commented 3 years ago

I'm not sure, I have not succeeded in reproducing the problem you describe, could you try to provide an online example if possible. (Codesandbox or GitHub CodeSpaces)