Skip to content

[css-scroll-anchoring] anchoring within contenteditable elements #11748

Open
@vmpstr

Description

@vmpstr

According to https://drafts.csswg.org/css-scroll-anchoring/#anchor-priority-candidates one of the priority candidates is the DOM Anchor of the focused element if that element supports text entry.

In practice it means that if we have a scrollable contenteditable element, then its the element itself that becomes the scroll anchor. However, there are situations where pages can add or remove content from within the contenteditable subtree (e.g. multiplayer text editor), which results in the scroll position within the contenteditable element to jump (since the element itself is anchored).

I propose we adjust the priority candidate to prioritize the nearest (perhaps the closest preceeding) element to the cursor within a focused contenteditable element. I'm not sure if there's a more general phrasing of this.

/cc @emilio @flackr

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Regular agenda

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions