Hi,
I've a very strange behavior trying to close the keyboard when closing a modalview.
My modalview is like this:
As you can see, my modalview contains a textarea and a cancel button to close the modalview. The cancel button is not at the same HTML-DOM level as the textarea.
The first time I open the modalview, click inside the textarea (to make the keyboard appear) and then click on cancel to close the modalview, all is going well => modalview closes, keyboard automatically disappear
The 2nd time I do this, the modalview also closes BUT the keyboard stays visible!
Now if I put the 'cancel' button JUST AFTER the textarea (at the same HTML-DOM level as the textarea), it's working every time.
Do you have an explanation on why this is happening?
By the way, does it give a function to programmatically open/close the keyboard?
Thanks for your support.
Bastien
I've a very strange behavior trying to close the keyboard when closing a modalview.
My modalview is like this:
<div id="modalview-create-post" data-role="modalview" style="width:100%;height:100%;" data-open="showCreateNewPost" data-init="initCreateNewPost"> <div id="modalview-post-content"> <div> <a id="new-post-cancel" data-click="closeCreateNewPost" data-role="button">Cancel</a> <a id="new-post" data-click="createPost" data-role="button">Post</a> <span id="new-post-count"></span> </div> <textarea id="new-post-txt" class="watermark" counterSelector="#new-post-count" ></textarea> </div> </div>function closeCreateNewPost() { forceBlurTextarea($('#new-post-txt')); $('#modalview-create-post').data('kendoMobileModalView').close();}
function forceBlurTextarea(textarea) {
$(textarea).val($(textarea).text());
var cssClass = $(textarea).attr('class');
$(textarea).attr('class', cssClass.replace("unwatermark", "watermark"));
}
As you can see, my modalview contains a textarea and a cancel button to close the modalview. The cancel button is not at the same HTML-DOM level as the textarea.
The first time I open the modalview, click inside the textarea (to make the keyboard appear) and then click on cancel to close the modalview, all is going well => modalview closes, keyboard automatically disappear
The 2nd time I do this, the modalview also closes BUT the keyboard stays visible!
Now if I put the 'cancel' button JUST AFTER the textarea (at the same HTML-DOM level as the textarea), it's working every time.
Do you have an explanation on why this is happening?
By the way, does it give a function to programmatically open/close the keyboard?
Thanks for your support.
Bastien