Make WordPress Core


Ignore:
Timestamp:
12/13/2014 10:07:58 PM (11 years ago)
Author:
azaozz
Message:

Do not autofocus text fields on page load on mobile devices. This is currently broken in many mobile browsers:

  • iOS Safari opens the keyboard and auto-scrolls on the first tap anywhere on the screen triggering the click at an unexpected place. That makes it impossible to follow links or press buttons.
  • Chrome on iOS opens the keyboard on load and may scroll the focused field off screen.
  • The Android 4.4 browser only highlights the field, the user has to tap it to open the keyboard and type.

See #30703.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-form-advanced.php

    r30754 r30842  
    648648?>
    649649
    650 <?php if ( post_type_supports( $post_type, 'title' ) && '' === $post->post_title ) : ?>
     650<?php if ( ! wp_is_mobile() && post_type_supports( $post_type, 'title' ) && '' === $post->post_title ) : ?>
    651651<script type="text/javascript">
    652652try{document.post.title.focus();}catch(e){}
Note: See TracChangeset for help on using the changeset viewer.