-
Notifications
You must be signed in to change notification settings - Fork 22.9k
Add note for anchor positioning fallbacks behavior #41419
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
Conversation
Developer's intuition for how anchor positioning fallbacks works does not match the specced behaviour, as demonstrated in [this poll](https://mastodon.social/@Meyerweb/115106404124445073) The spec is not expected to change - w3c/csswg-drafts#12682 - so a note to developers can help prevent this pitfall.
|
Preview URLs Flaws (113)URL:
(comment last updated: 2025-11-09 22:15:01) |
With it no longer being a sidenote, does the following lines "However" become disjointed? Co-authored-by: Estelle Weyl <[email protected]>
| @@ -199,6 +199,8 @@ Try scrolling so the anchor nears the edges: | |||
| - If you move the anchor near the top of the viewport, you will see the positioned element flip to the bottom-left of the anchor to avoid overflowing. | |||
| - If you move the anchor near the left of the viewport, you will see the positioned element flip to the top-right of the anchor to avoid overflowing. | |||
|
|
|||
| Depending on the browser, once the positioned element moves to the fallback position, it may remain in the fallback position even if the fallback positioning is no longer necessary, such as if updates to the user interface mean the space is available for it to return to the position defined by the {{cssxref("position-area")}}. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little worried with it not being a note that the "However" below is now disjointed from the bullet points.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe there is somewhere else on the page it is more appropriate to highlight this common developer pitfall
|
This pull request has merge conflicts that must be resolved before it can be merged. |
Josh-Cena
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with this and IMO it flows well enough. We say that "it avoids overflowing" and "it lazily avoids overflowing" and finally "it might not avoid overflowing if it can't".
Description
Adding a note for position-try-fallbacks to explain that the element does not revert to its original position when available space is restored.
Motivation
Developer's intuition for how anchor positioning fallbacks works does not match the specced behaviour, as demonstrated in this poll
The spec is not expected to change - w3c/csswg-drafts#12682 - so a note to developers can help prevent the pitfall of not understanding why it's not going back to the starting position.