I’m using jQuery mobile in a project and need a popup with a textarea on it:
<div data-role="popup" id="popupDialog" data-overlay-theme="none" data-theme="a" style="width: 350px; max-width:350px;" class="ui-corner-all" data-dismissible="false">
<button id="dialogCloseButton" data-theme="a" data-icon="delete" data-iconpos="notext" class="ui-btn-left">Close</button>
<div data-role="content" class="ui-corner-bottom ui-content" style="text-align: center; margin: auto;">
<textarea id="textArea" data-theme="b" style="resize: none; max-width: 100%; max-height: 150px; width: 100%; height: 150px; padding-bottom: 5px;"></textarea>
<button data-theme="a">Ok</button>
</div>
</div>
I’m opening the popup like this:
$('#popupDialog').popup('open');
When I now enter text in the textarea and close the popup using the button, the virtual keyboard won’t hide on my iPad running iOS 6.1.
I tried this hack, which didn’t work for me.
When I blur the textarea before closing the popup, the textarea will automatically get the focus again (you can test this on my example site using the “Blur”-button).
Edit: removed link to example.
This works for me: