Option to only scroll up and option to set an offset to the final position
We need two features:
Scroll one item of a long list to the top of the browser window - and only to the top of it. I called the option .alignWithTop with respect to the native .scrollIntoView() and its alignWithTop-argument. The type of .alignWithTop is boolean.
The second feature is an option to set some offset to the position to scroll to. I called the option .offset. The type of .offset is number || integer.
This PR implements both.
Great idea. .offset is useful. For .alignWithTop, it would be nice for it to fully imitate what it does in the native function; not only align to top if true, but align to bottom if false, and to force the alignment even if the element is already in view. With that in mind, something like {align:"top|bottom|auto", force:true|false} could do the trick, where {align:"auto", force:false} would be the default configuration and {align:"top", force:true} would match the native function. Thoughts?
Is this ever being considered?
+1
+1