Skip to content

Conversation

@djmarland
Copy link
Contributor

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.

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.
@djmarland djmarland requested a review from a team as a code owner October 7, 2025 09:01
@djmarland djmarland requested review from estelle and removed request for a team October 7, 2025 09:01
@github-actions github-actions bot added Content:CSS Cascading Style Sheets docs size/xs [PR only] 0-5 LoC changed labels Oct 7, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2025

Preview URLs

Flaws (113)

URL: /en-US/docs/Web/CSS/Reference/Properties/position-try-fallbacks
Title: position-try-fallbacks
Flaw count: 113

  • broken_links:
    • /en-US/docs/Web/CSS/CSS_values_and_units/Value_definition_syntax#single_bar is a redirect
    • /en-US/docs/Web/CSS/CSS_values_and_units/Value_definition_syntax#brackets is a redirect
    • /en-US/docs/Web/CSS/CSS_values_and_units/Value_definition_syntax#brackets is a redirect
    • /en-US/docs/Web/CSS/dashed-ident is a redirect
    • /en-US/docs/Web/CSS/CSS_values_and_units/Value_definition_syntax#double_bar is a redirect
    • and 87 more flaws omitted
  • macros:
    • Macro produces link /en-US/docs/Web/CSS/position-try which is a redirect
    • Macro produces link /en-US/docs/Web/CSS/position-try-order which is a redirect
    • Macro produces link /en-US/docs/Web/CSS/position-try which is a redirect
    • Macro produces link /en-US/docs/Web/CSS/position-area_value which is a redirect
    • Macro produces link /en-US/docs/Web/CSS/@position-try which is a redirect
    • and 16 more flaws omitted

(comment last updated: 2025-11-09 22:15:01)

djmarland and others added 2 commits October 14, 2025 10:52
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")}}.
Copy link
Contributor Author

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.

Copy link
Contributor Author

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

@github-actions
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@github-actions github-actions bot added the merge conflicts 🚧 [PR only] label Oct 30, 2025
@Josh-Cena Josh-Cena requested a review from a team as a code owner November 9, 2025 03:38
@Josh-Cena Josh-Cena requested review from estelle and removed request for a team November 9, 2025 03:38
@github-actions github-actions bot removed the merge conflicts 🚧 [PR only] label Nov 9, 2025
Copy link
Member

@Josh-Cena Josh-Cena left a 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".

@Josh-Cena Josh-Cena changed the title Add note for anchor positioning fallbacks behaviour Add note for anchor positioning fallbacks behavior Nov 9, 2025
@Josh-Cena Josh-Cena merged commit 5e8fe8c into mdn:main Nov 9, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:CSS Cascading Style Sheets docs size/xs [PR only] 0-5 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants