Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing the popup context doesn't work #4187

Closed
biswa-plutoflume opened this issue Apr 8, 2021 · 2 comments
Closed

Changing the popup context doesn't work #4187

biswa-plutoflume opened this issue Apr 8, 2021 · 2 comments

Comments

@biswa-plutoflume
Copy link

biswa-plutoflume commented Apr 8, 2021

Bug Report

Steps

I want the popup to be bound to a custom element with id - "main-wrapper", so I used the context prop as shown below, but the popup still gets bound to the body. I also tried using a ref instead but still didn't work.

<Popup
  basic
  content={content}
  context={document.getElementById('main-wrapper')}
  context={parentRef.current}    // Also tried using a ref
  trigger={<button>Click me</button>}
/>

Expected Result

The popup should get bound to the element with id - "main-wrapper"

Actual Result

The popup gets bound to the body.
image

Version

2.0.1

@welcome
Copy link

welcome bot commented Apr 8, 2021

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you've completed all the fields in the issue template so we can best help.

We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@layershifter
Copy link
Member

layershifter commented Aug 9, 2021

@biswa-plutoflume can you please provide a repro on CodeSandbox? You can fork our existing example that works, https://react.semantic-ui.com/modules/popup/#usage-context. I will reopen an issue once we will have a repro of the problem.

P.S. If you want to change a position in DOM (it's highlighted on a screenshot), you need to use mountNode prop.

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

No branches or pull requests

2 participants