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

Carbon overflow position hack #31

Open
photodow opened this issue Oct 2, 2020 · 0 comments
Open

Carbon overflow position hack #31

photodow opened this issue Oct 2, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@photodow
Copy link
Contributor

photodow commented Oct 2, 2020

So I added a setTimeout to position the overflow menu for settings. Something is off here, and this should be looked into more closely either within this codebase, or Carbon. Basically getBoundingClientRect within Carbon is returning 0, and so it's not making the proper calculations. Luckily for our needs at the moment positioning is pretty straightforward.

menuOffsetFlip={menuBody => {
  /* TODO: This is a temporary fix due to some odd bug in carbon/
  chrome that won't allow the getboundingclientrect to get a width.
  In return it won't render properly. This overrides that bit. Keep
  an eye on this. */
  setTimeout(() => {
    menuBody.style.left = 'auto';
    menuBody.style.right = 0;
  }, 0);
}}

https://github.com/carbon-design-system/devtools/blob/master/App/popup/components/MoreOptions/index.js#L16-L22

@photodow photodow added the bug Something isn't working label Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant