Re: [csswg-drafts] [css-contain-3] Proposal: Add an event to fire when content-visibility: auto state changes (#7384)

> For example if a virtual scrolled element is big enough for 10 rows, and a user focuses a text field in a row 1, then scrolls down to row 20 - would that mean that the DOM now has row 1 followed by rows 20-29? If so, is that desireable?

I think it's desirable, because if it was done by the user, they indicated via focus that they care about the thing being focused. However, if the virtual list was virtualized in chunks,  other chunks between the focused one and the near-screen would not be relevant to the user, and so could be deprioritized by the virtual list script-side implementation (as well as the browser).

Keeping focused elements, even if far off-screen, up-to-date is also important for accessibility APIs.

Virtual scroller implementations can also if they so desire by checking `document.activeElement` and calling `blur` on it. if the element is far off-screen and it therefore makes more sense to unfocus it in the web page UI.

-- 
GitHub Notification of comment by chrishtr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7384#issuecomment-1183576267 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 13 July 2022 19:04:18 UTC