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

Search Input - Focus problem #1459

Closed
ChadMC opened this Issue Apr 15, 2011 · 2 comments

Comments

Projects
None yet
5 participants
@ChadMC

ChadMC commented Apr 15, 2011

If you type something inside a search input textbox then press the "X" to clear the textbox, this clears the text and enables you to begin typing again. That part works fine.

If you already have something typed in the search input and are not focused inside of it or focused on something else then press the "X", the textbox is cleared but focus is not given back to the textbox, even though the textbox is highlighted.

This actually works fine in Google Chrome and Firefox. But it does not work on iPhone or Android.

@toddparker

This comment has been minimized.

Show comment
Hide comment
@toddparker

toddparker Apr 19, 2011

Contributor

Ah, that would be a nice touch. We'll add this focus tweak.

Contributor

toddparker commented Apr 19, 2011

Ah, that would be a nice touch. We'll add this focus tweak.

@ghost ghost assigned gseguin Aug 8, 2011

@sramam

This comment has been minimized.

Show comment
Hide comment
@sramam

sramam Sep 21, 2011

seems this had to do with the change event being triggered.
setting a focus after a timeout seems to solve the problem atleast on an iPad.
(Diff taken on 1.0b1)

3676,3677c3676,3677
-                                       input.val('').focus();
-                                       input.trigger('change');
---
+                                         input.val('').trigger('change');
+                                         setTimeout(function(){input.focus()}, 50);

sramam commented Sep 21, 2011

seems this had to do with the change event being triggered.
setting a focus after a timeout seems to solve the problem atleast on an iPad.
(Diff taken on 1.0b1)

3676,3677c3676,3677
-                                       input.val('').focus();
-                                       input.trigger('change');
---
+                                         input.val('').trigger('change');
+                                         setTimeout(function(){input.focus()}, 50);

@ghost ghost assigned Wilto Feb 15, 2012

@Wilto Wilto closed this in cbe4320 Mar 3, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment