SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Threaded View

  1. #1
    SitePoint Member
    Join Date
    Aug 2011
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ipad - keyboard opened on focusing textfield in iframe closes when we touch ipad

    Hi Everyone,

    I have strange problem with ipad - iframe textfield.

    I have a iframe poinitng to google.com. And i defined document or body or parent level events on the html page. Now when i click google search textfield on ipad, keyboard is launched.After that if i touch anywhere on ipad to scroll webpage keyboard closes. Please find the html file with extension txt in attachments - sample.html.

    HTML Code:
        <html>
        <head>
    
        </head>
        <body>
        <iframe src="http://google.com
        " width="700" height="700" scrolling="yes">
    
        </iframe>
        </body>
        <script type="text/javascript">
        function onF()
        {
        console.log('focus');
        }
        function onB()
        {
        console.log('blur');
        }
        document.ontouchmove = onF;
        document.ontouchend = onB;
        document.onmouseup = onB;
        </script>
        </html>


    Interestingly if i remove document or body or parent level events and try the same scenario - touch anywhere on ipad will not close keyboard and it allows to scroll the web page. - sample1.html

    HTML Code:
        <html>
        <head>
    
        </head>
        <body>
        <iframe src="http://google.com
        " width="700" height="700" scrolling="yes">
    
        </iframe>
        </body>
        <script type="text/javascript">
        function onF()
        {
        console.log('focus');
        }
        function onB()
        {
        console.log('blur');
        }
        </script>
        </html>


    Can anyone explain me why it is behaving like this. Or provide a solution to stop keyboard not to close.

    Thanks,
    Sarath
    Last edited by Mittineague; Aug 28, 2011 at 21:46. Reason: reformatting bbcode tags


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •