mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +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:
@@ -155,6 +155,8 @@ do_meta_boxes(null, 'normal', $comment);
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php if ( ! wp_is_mobile() ) : ?>
|
||||
<script type="text/javascript">
|
||||
try{document.post.name.focus();}catch(e){}
|
||||
</script>
|
||||
<?php endif;
|
||||
|
||||
Reference in New Issue
Block a user