W3C home > Mailing lists > Public > www-style@w3.org > March 2016

[cssom-view] smooth scroll on focus()?

From: Rick Byers <rbyers@chromium.org>
Date: Thu, 3 Mar 2016 22:19:34 -0500
Message-ID: <CAFUtAY-bA1dVwd9PBRQxMEAM1rvkv7WLRwFef_xxbS1f-TRNXA@mail.gmail.com>
To: "www-style@w3.org" <www-style@w3.org>
Cc: Rob Dodson <robdodson@google.com>
CSSOM View scroll-behavior says: "The scroll-behavior property specifies
the scrolling behavior for a scrolling box, when scrolling happens due to
navigation or CSSOM scrolling APIs. Any other scrolls, e.g. those that are
performed by the user, are not affected by this property".  To me this
suggests that if the user agent scrolls as a result of a call to
Element.focus(), that scroll-behavior should not be respected.

Is that intentional?  It seems unfortunate (eg. for accessibility) that
it's possible to get a smooth scroll to an element via
Element.scrollIntoView, but not if you also want the element to be receive
focus in the process.

Perhaps scrollIntoView should now return a promise (or ScrollOptions should
take a callback) so that an action like 'focus' can be performed when the
scroll animation completes?

Thanks,
   Rick
Received on Friday, 4 March 2016 03:20:24 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:09:01 UTC