Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Typeahead does not allow blur on select #4206

Closed
rmunch opened this issue Aug 13, 2015 · 4 comments
Closed

Typeahead does not allow blur on select #4206

rmunch opened this issue Aug 13, 2015 · 4 comments

Comments

@rmunch
Copy link

rmunch commented Aug 13, 2015

I'm trying to configure my UI so that if a typeahead suggestion is selected, the UI automatically focuses the next field in the form. The behavior I'm seeing is that the next field is focused correctly, but then the typeahead field takes the focus back. It looks like the code that is causing this is:

$timeout(function() { element[0].focus(); }, 0, false);

It seems like this behavior should be optional. Thanks!

@rmunch rmunch changed the title Typeahead select does not allow blur on select Typeahead does not allow blur on select Aug 13, 2015
@wesleycho
Copy link
Contributor

Just to verify, you don't want it to focus on the input element after blur with typeahead-select-on-blur="true"? The Plunker here displays this behavior currently.

@rmunch
Copy link
Author

rmunch commented Aug 13, 2015

I think my issue is not that the field is refocused on select, but that the refocus happens after the onSelectCallback() callback is called, so the refocus can't be prevented.

Maybe the onSelectCallback() callback could be called inside the $timeout callback just after the call to element[0].focus()?

@wesleycho
Copy link
Contributor

In reality, it sounds like you want a way to cancel the focus - let me think on this a bit, not sure what the best way to approach this would be.

@chriso86
Copy link

chriso86 commented Apr 5, 2018

Hi guys,

Was this ever resolved? I'm losing a part of my soul trying to get this to work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants