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

Generalize toolbox positioning to support relative-offset context elements #553

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gibson042
Copy link
Contributor

@michaelficarra
Copy link
Member

Let's hold off on this until we get approval on the strategy for #552.

@gibson042
Copy link
Contributor Author

Why? Assuming static positioning for so many elements is unnecessarily brittle.

@michaelficarra
Copy link
Member

I just don't want to introduce the complexity until it buys us something.

@gibson042
Copy link
Contributor Author

Well, I'd like to adopt #552 with a local stylesheet but doing so breaks the toolbox positioning without something like this. I can address that locally as well, but the code here is strictly a generalization—when el.offsetParent itself has no offsetParent (as is the case for relevant elements with the current stylesheet), then getAbsoluteOffset(el, 'offsetTop') is equivalent to the el.offsetTop that it's replacing, and likewise for offsetLeft. It only has an effect when that assumption doesn't hold, in which case the effect is to fix what would otherwise be a bug.

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