Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Popup Reappears after closing when textarea input field expanded on iOS 6 #5157

Closed
buckolas opened this issue Oct 11, 2012 · 9 comments
Closed

Comments

@buckolas
Copy link

On iOS 6, I have an issue when I use a textarea inside of a popup. Here is my HTML:

 <a href="#popupBasic" data-rel="popup">Open Popup</a>
 <div data-role="popup" id="popupBasic">
 <form>
 <div data-role="fieldcontain">
 <label for="comment">Comments:</label>
 <textarea name="comment" id="comment" data-mini="true"></textarea>
 </div>
 <input type="submit" value="Submit" data-mini="true"/>
 </form>
 <a href="#" data-role="button" data-rel="back" data-mini="true">Close</a>
 </div>

When the popup opens, if I enter multiple lines of text in the textarea and it expands down, then click the Close button, the popup closes and then reopens until I rotate the display or refresh the page.

@cwburggrab
Copy link

I'm also experiencing this issue, but it doesn't happen every time.

After reappearing, the popup cannot be closed with either the close button added to the header of the popup using the data-rel="back" attribute or clicking outside the popup itself.

I also tried using onclick="$('#id').popup('close');" on a button with no success.

<div id="id" data-role="popup" style="width: 600px">
       <div data-role="header">
              <h3> TestEntry</h3>
       </div>
       <div data-role="content">

              <label>Test:</label>

              <input id="test" type="text"  />           

              <a href="#" data-role="button" data-icon="delete" onclick="$('#id').popup('close');">Cancel</a>

              <button type="submit" data-theme="b">OK</button>
       </div>       
</div>
@buckolas
Copy link
Author

I have seen this issue occur in several places, but my included example above is the only one that I could come up with that is easily reproducible.

@buckolas buckolas reopened this Oct 11, 2012
@MauriceG
Copy link
Contributor

I've tested with http://jsfiddle.net/MauriceG/QCZ87/show/light/ on iPhone 4S iOS 6 and I don't see an issue.

@buckolas
Copy link
Author

Would you mind try adding a close button with data-rel=back? Wonder if it may have something to do with it

@MauriceG
Copy link
Contributor

Ok, done: http://jsfiddle.net/MauriceG/QCZ87/2/show/light (http://jsfiddle.net/MauriceG/QCZ87/2/)
and tested again.

I see that issue in landscape view now.
A second tap on the close button goes back in history then...

@buckolas
Copy link
Author

Yes, that is what I am seeing as well. Any ideas on the cause?

@cwburggrab
Copy link

Ditto on what I am seeing too.

@MisterDr
Copy link

I looked at the issue too, it seems that it is happening only when you resize the popup entering the text, clicking on the close button while your keyboard is on.

It is never happened when you turn off the keyboard and click the close button.

I believe when you click the stop button, keyboard is sliding down causing the document to resize (maybe the resize event), therefore emitting the show event on the popup.

@gabrielschulhof
Copy link

Please check again with the latest master. If you can reproduce the error, please reopen this issue.

scottjehl pushed a commit that referenced this issue Oct 31, 2012
* master: (24 commits)
  [select] Implement _destroy() -- Fixes #4661
  Changing ok out to equal; it is more appropriate for this test
  Changing test to make sure it fails when code change is not there
  Renamed class ui-selectmenu-hidden to ui-popup-hidden -- Fixes #5217
  [popup] Rename function _maybeRefreshTimeout to _expectResizeEvent
  [popup] "detached retina" fix - the window height on iStuff with a retina display seems to fluctuate by one pixel during scroll, causing a spurious resize event right after popup open, even though window size is constant during the entire opening sequence
  Added "mobileinit" handler to set up options
  Whitespace
  Changed urlParseRE to ignore space at beginning. This is expected behavior in browsers. This used to result in pages changing to "%20destination.html" instead of the now "destination.html". Fixes issue #4882
  List autodividers: use trim() to avoid issues with newlines and spaces in markup. Fixes #5197. Thanks @demonslord !
  [popup] Initiate resize expectation during orientationchange -- Fixes #5153
  Select: headers of custom select menus shouldn't inherit the popup corner styling. Fixes #5215.
  [popup] Correctly handle the case when the fallback transition is "none" -- Fixes #5189
  [custom select] Mark as closed after dialog closes - Re: #5195 - Thanks martenbohlin
  [slider] Adding new behaviour to widget definition
  [select] Adding new behaviour to widget definition
  [checkboxradio] Adding new behaviour to widget definition
  [formReset] New behaviour that allows form widgets to become aware of the fact that the form they are in has been reset
  [popup] Only rapid-open the popup if it is open -- Fixes #5157
  Updated third-party libs for Backbone/Require Demo App
  ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.