carbon-design-system / carbon-design-system/devtools
Carbon overflow position hack
- Dominant language
- JavaScript
- Stars
- 46
- Forks
- 23
- PR merge metrics
- No merged PRs in 30d
Description
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.
```javascript
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
Contributor guide
Assessment
This issue has not been assessed yet.