-
-
Notifications
You must be signed in to change notification settings - Fork 133
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
[BUG] When using down or up arrow, the mat-select scrollTop isn't calculated correctly #119
Comments
@Mabiro thanks for reporting this issue. it seems this is not so easy to fix, and as you stated, overwriting the |
one way to achieve this could be something similar to where we listen for keymanager changes and if the option is covered by the search input, shift the scrolltop |
@Mabiro would you like to try to implement the fix I suggest? |
Sure, I'll take a look at this. I am not sure how to determine whether the option is covered by the search input in clean manner, but I'll give it a shot. Thanks! |
"covered" would be if |
@macjohnny : Gave it a try, let me know what you think! #120 |
…er-search-input #119 - Issue with scrollTop and keyboard selection
this is release in |
Thanks for this component!
I realize this might not be possible to fix without a dirty hack like I provided in the "Additionnal Context" section, but I thought maybe you'd be able to give a better approach.
Describe the bug
It looks like the height of the ngx-filter and the fact that it is above the other mat-options makes it so the mat-select can't calculate correctly where the scrolltop of its panel should be.
When using the component inside a mat-option, the issue is when going "up" with the up arrow.
When using the component outside of a mat-option, the issue is when going "down" with the down arrow.
To Reproduce
The same can be observed with the component outside of a mat-option, but it's the other way around.
Expected behavior
When navigating up or down, the active item should correctly be displayed in the mat-select panel.
Screenshots
Desktop (please complete the following information):
Additional context
I was able to "fix" the issue by overriding private methods of MatSelect, but I would rather stay away from this:
It's the same implementation, but the height of the filter is substracted from "max height". I tested it with my ngx-search outside of the mat-option, but not inside. So it might not work for both.. maybe its +51 in that case? not sure..
The text was updated successfully, but these errors were encountered: