-
Notifications
You must be signed in to change notification settings - Fork 6.8k
refactor(select,autocomplete): consolidate logic for scrolling options into view #9630
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
refactor(select,autocomplete): consolidate logic for scrolling options into view #9630
Conversation
src/lib/core/option/option.ts
Outdated
* @param currentScrollPosition Current scroll position of the panel. | ||
* @param panelHeight Height of the panel. | ||
*/ | ||
static getScrollPosition(optionIndex: number, optionHeight: number, currentScrollPosition: number, |
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.
Could this be a standalone function rather than living on MatOption
? Should this also be internal?
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.
I went for consistency since the countGroupLabelsBeforeOption
is also a static method. I'm fine with making it internal, but I can see it being useful if somebody is implementing a component that uses MatOption
.
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.
I'd rather keep the public API smaller and see if it comes up as a request first
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.
Done.
…s into view Combines some duplicated logic for determining how to scroll an option into view into a single place so it's easier to maintain.
739ef05
to
aab7426
Compare
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.
LGTM
…s into view (#9630) Combines some duplicated logic for determining how to scroll an option into view into a single place so it's easier to maintain.
…s into view (#9630) Combines some duplicated logic for determining how to scroll an option into view into a single place so it's easier to maintain.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Combines some duplicated logic for determining how to scroll an option into view into a single place so it's easier to maintain.