locked
Virtual Keyboard moves my application window but doesn't move it back. RRS feed

  • Question

  • In my app I have an input field right in the center of the screen. When I tap into that input field on a Samsung tablet it brings up the virtual keyboard. When doing this it moves the whole app screen a bit up, presumably so that the input field is nicely visible.

    The problem is that when closing the virtual keyboard it doesn't move the window back!

    Any pointers? 

    I stumbled upon the InputPane class which allows me to hook up an event when the virtual keyboard shows/closes but I fail to understand how I can prevent this issue. The offset doesn't seem to be applied to the document body and I have no idea how this offset achieved.


    • Edited by PatrickKlug Thursday, June 14, 2012 1:20 AM
    Thursday, June 14, 2012 1:20 AM

All replies

  • Hi Patrick,

    Please post a simple repro of the problem.  This is not normal behavior.

    -Jeff


    Jeff Sanders (MSFT)

    Thursday, June 14, 2012 1:49 PM
    Moderator
  • Well, I've tried for the last 4 hours to reproduce this in a small app. No luck.

    In my actual project this happen consistently. 100% reproducible. I have tried to find the source of the offset that is applied but couldn't. All I know is that as soon as I close the Virtual Keyboard the DOM Inspector shows an offset of -24px on the document body. I never set any styles on the document body and the style inspector doesn't show where this -24px comes from.

    Any subsequent showing/hiding of the Virtual Keyboard subtracts another 24px from the offset moving my app further and further up.

    I really don't know what to look for :/ Any pointers on where to look?


    Friday, June 15, 2012 2:12 AM
  • Patrick,

    Can you send me an email here for further investigation?

    http://blogs.msdn.com/jpsanders/contact.aspx

    -Jeff


    Jeff Sanders (MSFT)

    Friday, June 15, 2012 12:11 PM
    Moderator
  • Hi,

    I've got this bug once. But it was with the appbar on a pc.

    After the emergence of the appbar, the body on the background would slide up. I found out that it was because of the bottom scrollbar.

    The scrollbar wasn't showing at first but after the slide up, I can saw it at the bottom of the screen.

    • Marked as answer by Dino He Monday, July 9, 2012 10:38 AM
    • Unmarked as answer by PatrickKlug Tuesday, July 10, 2012 6:06 AM
    Thursday, June 21, 2012 7:58 AM
  • I'm having a similar problem...

    I have a textbox inside a scrollviewer. When I touch the textBox, the virtual keyboard comes up. FINE.

    But when I touch anywhere outside the textBox, the keyboard does not dismiss and textBox LostFocus event is not even raised. If I touch outside the scrollviewer, keyboard is dismissed and LostFocus (on the textBox) is fired normally...Not sure if this is a normal behaviour or if I'm doing something wrong with that scrollviewer.

    Thursday, July 5, 2012 5:20 PM
  • This is not an answer. First, the situation seems similar and secondly I don't understand what the supposed 'solution' is.

    I have already provided Jeff with a repro app and he confirmed to me that he can reproduce the issue. No solution has been provided yet.

    Tuesday, July 10, 2012 6:07 AM