mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-14 05:40:30 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@30842 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -647,7 +647,7 @@ if ( post_type_supports( $post_type, 'comments' ) )
|
||||
wp_comment_reply();
|
||||
?>
|
||||
|
||||
<?php if ( post_type_supports( $post_type, 'title' ) && '' === $post->post_title ) : ?>
|
||||
<?php if ( ! wp_is_mobile() && post_type_supports( $post_type, 'title' ) && '' === $post->post_title ) : ?>
|
||||
<script type="text/javascript">
|
||||
try{document.post.title.focus();}catch(e){}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user