Skip to content

Fix content positioning for non-relative non-document body contentLocation elements#662

Merged
brianvoe merged 5 commits intobrianvoe:masterfrom
AnthonyANI:fix-content-positioning
Dec 6, 2025
Merged

Fix content positioning for non-relative non-document body contentLocation elements#662
brianvoe merged 5 commits intobrianvoe:masterfrom
AnthonyANI:fix-content-positioning

Conversation

@AnthonyANI
Copy link
Contributor

@AnthonyANI AnthonyANI commented Nov 25, 2025

This PR addresses a bug that causes the dropdown content to be positioned incorrectly when it is set within a non-relative child other than the document.body (calculations were always done based on the viewport rather than the offsetParent of contentLocation).

See example: https://codepen.io/AnthonyANI/pen/ByKZMZg

It also corrects the border style for the search element when opening content in the up direction.

@AnthonyANI
Copy link
Contributor Author

Found a potential bug in the changes with main and content div inside same scrollable element.

@AnthonyANI AnthonyANI closed this Nov 25, 2025
@AnthonyANI
Copy link
Contributor Author

Fixed - removed no-longer-necessary scroll offset logic causing incorrect position

@AnthonyANI AnthonyANI reopened this Nov 25, 2025
@AnthonyANI
Copy link
Contributor Author

Found a better way to reproduce in codepen and there are still some issues, although it's better than it was. Will revisit this when I can take a closer look.

@AnthonyANI AnthonyANI closed this Nov 25, 2025
@AnthonyANI
Copy link
Contributor Author

Hello again. Turns out I wasn't even testing my fixes (it was loading from a branch where the changes had not yet been built for dist). These changes are good to go.

@AnthonyANI AnthonyANI reopened this Dec 6, 2025
@brianvoe brianvoe merged commit 1ad2ec9 into brianvoe:master Dec 6, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants