Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I managed to prevent the momentary overlay shift by setting <code>outline: none</code> on my <code>input</code> element.</p> <p>I got the wild page scrolling and disappearing keyboard to settle down by setting <code>overflow: hidden</code> on the html <code>body</code> when showing the dialog, and then removing it again when hiding the dialog. This has a nasty side effect of resetting the page's scroll position, so I save it and restore it as necessary, and wrap all this hackery in conditionals so it only runs on Android. (I hope my Android users won't be too distracted when they see the page contents change beneath the semi-transparent overlay while the dialog is open.)</p> <p>Interestingly, I was also able to prevent the wild page scrolling by catching the <code>touchstart</code> event on my overlay element and calling preventDefault(). This makes me wonder if all this madness was caused by a sequence of events like this:</p> <ul> <li><code>touchstart</code> bubbles up to the document root</li> <li>browser sees <code>touchstart</code> where the duplicate input field was placed</li> <li>browser gives focus to the input field</li> <li>soft keyboard appears to allow typing in the input field</li> <li>viewport gets resized to accommodate the soft keyboard</li> <li>resized viewport during touch event looks like a touch drag to the browser</li> <li>spurious drag causes the page to scroll and dismisses the keyboard</li> </ul> <p>I didn't end up catching <code>touchstart</code> to solve the problem, because it prevented the input field from gaining focus, and calling <code>focus()</code> from javascript just didn't work. I have read that the Android browser disables the <code>focus()</code> method on input fields, which would explain this behavior. Perhaps it does this because it wouldn't work with the duplicate text widgets it creates over the html-defined fields.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload