W3C home > Mailing lists > Public > public-css-archive@w3.org > September 2017

Re: [csswg-drafts] [cssom-view] Add notIfViewed to ScrollIntoViewOptions; add FocusScrollOptions

From: Simon Pieters via GitHub <sysbot+gh@w3.org>
Date: Fri, 15 Sep 2017 12:01:02 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-329761911-1505476852-sysbot+gh@w3.org>
Another approach could be to add "-if-needed" suffixes to the keywords in LogicalScrollPosition. The current `nearest` already has "if needed" semantics, as specified. This would give more control as it lets developers specify "if needed" separately for the two dimensions.

focus({ preventScroll: true });
focus({ scrollOptions: { block: "center", inline: "center" } });
focus({ scrollOptions: { block: "center-if-needed", inline: "center-if-needed" } });
scrollIntoView({ block: "start" });
scrollIntoView({ block: "start-if-needed" });
enum ScrollLogicalPosition { "start", "start-if-needed", "center", "center-if-needed", "end", "end-if-needed", "nearest" };
(No change to `nearest` for compat.)

GitHub Notification of comment by zcorpan
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/pull/1805#issuecomment-329761911 using your GitHub account
Received on Friday, 15 September 2017 12:01:16 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:18 UTC