Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Popup <input> doesn't loose focus #5706

Closed
vkammerer opened this Issue · 15 comments

7 participants

@vkammerer

Hello JQM community,

After opening a popup including form elements like input and textarea (only types tested so far) and giving the focus to one of these elements, it is impossible to loose focus again, unless your close the popup.

This bug is visible on the current Demo center.

Steps to reproduce:
1 - go to the popup page of the demo center:
http://view.jquerymobile.com/master/docs/widgets/popup/
2 - Scroll down to the Form section and click the "Sign In" button
3 - Set focus to one of the input fields.
4 - Try to click somewhere else in the popup: You can't loose focus again!

Tested on:

  • Desktop: Windows 7 / Chrome Canary
  • Mobile: Galaxy Note 2 / Android 4.1.2 / Webview (Phonegap)
@agcolom
Collaborator

@vkammerer I am not experiencing this issue but I have a different setting from yours.

Working fine on:
Desktop: OS X 10.6.8 FF18.0.2, Safari 5.1.7 and Chrome 25.0.1364.99
Mobile: iPod Touch iOS 5.0.1

@vkammerer

@agcolom thanks for the reply!

I did more testing and I could reproduce the bug on all environments:

on Galaxy Note 2 / Android 4.1.2:

  • up to date Chrome.
  • Android Stock browser.
  • Webview.

on desktop / Windows 7:

  • Safari 5.1
  • Firefox 18.0
  • Chrome 25.0.1364.97 m

If you first click on an input field and then click somewhere else in the popup (like on the "Please sign in" h3), do you loose the focus on the input?

Moreover, I noticed that if you first open a popup, set focus to one of its fields, close the popup by clicking outside, and then open the same popup again, it will automatically set focus to the input after 1 or 2 seconds.

@vkammerer

@agcolom I am only reading now the description of the component : "You can place a form inside a popup. When it opens, focus will be restricted to elements inside the popup."

So it seems that this component is behaving so by design and that this is not a bug.

I'm a bit dubious about this behaviour though, as it can be interesting to place other elements in popups that can be focused.

@vkammerer

@agcolom actually, this is a bug:

the description says:
"focus will be restricted to elements inside the popup"

but it doesn't say
"focus cannot be lost inside the popup"

The behaviour I am experiencing in my Android Phonegap app is that the soft keyboard keeps popin after setting focus to a field inside a popup. I am sure this can't be so by design.

@agcolom
Collaborator

@vkammerer I get what you mean now. Sorry I thought that you could not lose focus on a previously focused input filed inside a a popup. Yes, it seems that the only way to lose focus on an input field inside a popup is to click/tap inside another input field and get that new one into focus. So if this is what you meant, then I can reproduce :-)

@uGoMobi Is that something that we can look at? Outside of popups, tapping/clicking outside of a previously selected (in focus) input field, tapping/clicking outside of that input field will cause it not to be in focus anymore. However, inside the popup, this is not happening. So if you have tapped/clicked inside a form element inside a popup, clicking outside of that form element in the popup will not allow this input field to lose focus (except if you click inside another form element on the popup, but then the problem is just passed to another form element, and so not resolved)

@vkammerer

@agcolom thanks! your question to @uGoMobi is exactly what I was trying to explain :-)

@jaspermdegroot
Collaborator

@gabrielschulhof - Can you weigh in here? Thanks!

@gabrielschulhof gabrielschulhof closed this issue from a commit
@gabrielschulhof gabrielschulhof Popup: When focusing on the container, do not bounce focus to an elem…
…ent inside it even if such an element is available. Fixes #5706.
c605423
@gabrielschulhof
Collaborator

@vkammerer Could you please verify that this fix results in the popup behaviour you desire?

@gabrielschulhof gabrielschulhof referenced this issue from a commit
@gabrielschulhof gabrielschulhof Popup: When focusing on the container, do not bounce focus to an elem…
…ent inside it even if such an element is available. Fixes #5706.

(cherry picked from commit c605423)
25f01a7
@vkammerer

@gabrielschulhof it's all good now, thanks!

@eshangin

I had the same problem on IPhone. Thanks a lot!

@borgy3377

Hi, this problem seems to have come up again in 1.4.5. Working okay in 1.3.2.

Platforms - Safari iOS 8.1.2 (iPad) and Chrome 40.0.2214.93 (Win32).Thanks. Daniel.

@borgy3377

After further investigation, it looks like this issue did not exist in 1.4.4. This is really annoying especially if the first element inside the popup is a select. Thanks. Daniel.

@Soulcyber

i have the same problem with 1.4.5, cant loose focus of input popup without clicking another input field...

@borgy3377

Hi Soulcyber, we just ended out using 1.4.4. It may not be the ideal solution and I'm sure it can be worked around but everything else in our application works okay now. Thanks. Daniel.

@Soulcyber

Thanks Daniel :+1:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.