-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
onFocus causes auto scroll to x=0 when search is hidden #1686
Comments
I can reproduce in Safari using the provided Fiddle. Thanks for reporting, @demesne. |
Did some css inspection, particularly around |
Changing the search box from being placed at -9999 to not being displayed.
I've tried this in both Chrome and Safari and I'm not seeing the problem. Can you guys walk me through this step-by-step and tell me exactly what I'm looking for? |
@pfiller In the Fiddle, scroll all the way to the right, and click the right-most Chosen select. The scroll position jumps all the way back to the left. |
Thanks @tjschuck. Got it. This is caused by two lines that are calling The most straightforward solution is to not call focus on the disabled search field. Unfortunately, that looks something like this right now as there's no method to tell if it should be disabled. We should add one! @search_field.focus() unless @disable_search or @form_field.options.length <= @disable_search_threshold |
Great work on the Plugin!. Just updated to v1.1.0. I see the this issue is not just limited to scrolling to x=0 when selecting using mouse. When the chosen drop down receives focus while tabbing the scrolling is still occurring. I have applied above fix with respect to search_field.focus() in chosen.jquery and has helped when selecting using mouse( scrolling doesn't happen) but this still scrolls when tabbing. |
Hi guys, We also run in this issue.
|
When search box is hidden, and a chosen select is clicked(only on focus), the page auto-scrolls to the hidden search input box, which should not be the case.
Sample:-
http://jsfiddle.net/2bVBN/
The text was updated successfully, but these errors were encountered: