Description
Description
Adding a new scroll-to
functional modifier that mimics the native scrollTo.
It is possible that we only want to perform a scroll-to
if a certain condition is satisfied, so this modifier will optionally take a boolean to know when to trigger its scroll-to
API
The arguments are chosen to closely mimc the API of the native scrollTo, which supports 2 positional arguments or a named option. We just add one more API to support the optional boolean.
Positional arguments: [top, left, shouldScroll] or scrollOptions
Named arguments: { top, left, behavior, shouldScroll }
Examples
Debating between explicit positional arguments and a single positional object containing the config, which gives more flexibility if the native scrollOptions API happens to change.
vs
Named