-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(esl-utils): ScrollIntoView new implementation #1001
base: epic/scroll-into-view
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a couple of critical structural notes here.
But, basically, I'd want to hold the final review here with the architectural rework first. The final API doesn't look great to me at this point.
So just let me summarize the tech requironments, I need a little bit more time to rethink the API first, so marking PR as not ready for merge
right now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fshovchko, please see the use case example pushed to the branch
It looks like scrollIntoView
currently does not pass successfully for the dynamic content scenario when page scroll is used (the testing wasn't successful on the clients' side for the same reason).
Needs presentational updates from #1022 |
In the scope of this PR i added promisified version for scrollIntoView().
Parameters:
element - the element which should become visible
options (Optional)
For boolean value:
If true, the top of the element will be aligned to the top of the visible area of the scrollable ancestor. Corresponds to scrollIntoViewOptions: {block: "start", inline: "nearest"}. This is the default value.
If false, the bottom of the element will be aligned to the bottom of the visible area of the scrollable ancestor. Corresponds to scrollIntoViewOptions: {block: "end", inline: "nearest"}.
For Object with the following properties:
behavior (Optional) - defines the transition animation. One of auto or smooth. Defaults to auto.
block (Optional) - defines vertical alignment. One of start, center, end, or nearest. Defaults to start.
inline (Optional) - defines horizontal alignment. One of start, center, end, or nearest. Defaults to nearest.