Skip to content

fix:dropdown losing focus when using scrollToFocus from anoter editfield #5186

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

Merged
merged 1 commit into from
Oct 19, 2016

Conversation

crazycactuz
Copy link
Contributor

The simplest possible solution i found to fixing an issue where selects with the "ui-grid-edit-dropdown" attribute would loose focus directly after getting it when trying to focus it with scrollToFocus while editing another field.

Simplified scenario: i have a textbox in the grid, if i type 2 i scrollToFocus to column 2, if i type 3 i scrollToFocus to column 3. This works great for all columns that isnt using the ui-grid-edit-dropdown attribute in the editTemplate. I compared the code for ui-grid-editor and ui-grid-edit-dropdown and noticed that ui-grid-editor has its elm[0].focus() inside a timeout. When applied to my issue this solved it,and it did not seem to cause any form of regression. Since it is already approved for use on the grid-editor attribute, i thought it would be reasonable to add it here too.

Did not know if i should add only the focus or everything in the timeout, so i went with least amount possible.

@crazycactuz crazycactuz changed the title fix: Fix for dropdown losing focus when using scrollToFocus from anot… fix:dropdown losing focus when using scrollToFocus from anoter editfield Mar 3, 2016
@dlgski dlgski merged commit 13a1117 into angular-ui:master Oct 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants