Conversation
|
|
|
🤖 Lint issues have been automatically fixed and committed to this PR. |
1aab292 to
848c19c
Compare
|
🤖 Lint issues have been automatically fixed and committed to this PR. |
|
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/18084 |
| if (anchorElement) { | ||
| const overlayWidth = width ? parseInt(widthMap[width]) : null | ||
| const result = getDefaultPosition(anchorElement, overlayWidth) | ||
|
|
||
| if (result) { | ||
| currentOverlay.setAttribute('data-align', result.horizontal) | ||
| currentOverlay.style.setProperty('--anchored-overlay-anchor-offset-left', `${result.offset}px`) | ||
| } |
There was a problem hiding this comment.
This was added as a solution for https://github.com/github/primer/issues/6511. We calculate the required offset for the overlay to be where it can have the most space within the viewport.
This does mean we rely on JS + CSS, but this is a pretty lightweight way to do it. We'll only use JS when there isn't enough space for the overlay to exist, otherwise we rely fully on CSS anchor positioning
Closes #
Changelog
New
Changed
Removed
Rollout strategy
Testing & Reviewing
Merge checklist