Home>Support>Page zooming (on mobile) when interacting with contact form input fields…

Page zooming (on mobile) when interacting with contact form input fields…

Hi,

I have a problem with page zoom on mobile when interacting with form elements. The page is here:

http://www.juaba.com/contact-us/

I figured it could be due to the viewport tag being:

…as oppose to:

Although i’m not sure how I could fix that?

The page zooming then leads to the user being able to horizontal scroll, which is not great!

Any ideas?

URL: http://www.juaba.com/contact-us/

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 9 years, 3 months ago Darren Clark

    Current meta:

    meta name=”viewport” content=”width=device-width, initial-scale=1″

    …should it be?

    meta name=”viewport” content=”width=device-width, initial-scale=1, maximum-scale=1″

  2. 9 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    Hi Darren

    Thanks for the wait.

    The current viewport setup is relatively standard for responsive sites and give the user the freedom to zoom as required.

    Have you perhaps been testing on iOS Safari? Let’s perhaps try the following added to Appearance > Custom CSS:

    input[type='text'],
    input[type='number'],
    textarea {
      font-size: 15px;
    }
    

    Ref: http://stackoverflow.com/questions/2989263/disable-auto-zoom-in-input-text-tag-safari-on-iphone

    Let me know how that goes.

  3. 9 years, 2 months ago Darren Clark

    …tried this but no luck:

    input[type='text'],
    input[type='number'],
    input[type='email'],
    textarea {
      font-size: 15px!important;
    }
    
  4. 9 years, 2 months ago Darren Clark

    Forgot to say that yes this is happens on both Mobile Chrome & Mobile Safari on iOS.

    Can’t help but feel that if we set the maximum scale to 1 in the viewport tag that it might correct it.

    Just not sure how to amend that at all?

    Are you able to try this your end – have you experienced this horizontal scroll previously? Could it be to do with the meta slider at all?

  5. 9 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    It looks to be an iOS Safari specific behavior. Something that Safari adds to sites. Can you please check if the same thing happens if you switch to a default theme like Twenty Fifteen.

  6. 9 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    I’m not seeing the problem in iOS Chrome. Not that I can see anyway. Here is a child theme to change the viewport tag:

    https://siteorigin.com/wp-content/uploads/2015/07/origami-child-no-scale.zip

    Download ZIP to desktop.
    Install from Appearance > Themes > Add New: Upload ZIP.
    Activate.
    Check. If correct then:
    Redo Appearance > Customize and Appearance > Menu Settings. They reset when a child theme is activated.

    If you want to see the change go to Appearance > Editor > functions. We’ve de-registered the old action and added our own new edited action for the viewport.

    Hope that helps.

  7. 9 years, 2 months ago Darren Clark

    This seems to have fixed the problem, just a matter of me copying the styles across now!

  8. 9 years, 2 months ago Darren Clark

    Although it seems I now don’t have the custom CSS option? Is this a Vantage theme fix?

  9. 9 years, 2 months ago Darren Clark

    Is there any way to apply this similar patch to the Vantage setup that I currently have, rather than having to restyle it all?

  10. 9 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    Wow. Definitely working too late with too many threads open. So sorry for the delay. I’ll re-build this child theme for Vantage now.

    (You shouldn’t have to copy any CSS rules when activating a child theme).

  11. 9 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    Right, let’s try this again.

    https://siteorigin.com/wp-content/uploads/2015/07/vantage-child-no-scale.zip

    Switch back to Vantage.
    Hover over Origami Child. Delete.
    Install this ZIP from Appearance > Themes > Add New: Upload Theme.

    Apologies again for the mistake.

  12. 9 years, 2 months ago Darren Clark

    Hi,

    Sorry Andrew, i’ve implemented this change. Gone back and amended any CSS that had been styled via the customise menu (as oppose to custom CSS) to get me back to where I was, tested it on Chrome & Safari on iOS mobile – iPhone 6 and the issue is still there?

    Can you help?

    Thanks,
    Darren

  13. 9 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    Would you mind temporarily switching over to Twenty Fifteen or any other default theme and re-testing. I want to see if the zoom is happening with another stylesheet in use. Thanks.

  14. 9 years, 2 months ago Darren Clark

    Sure – done

  15. 9 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    The child theme looks to be functioning as expected. I’d suggest sticking with it. If ever need to make a custom edit in the future you won’t need to redo all the Customize settings agian.

  16. 9 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    Could you check too please. I don’t have the issue in iOS (iPhone) Chrome but didn’t before either.

    Checking iOS Safari now.

  17. 9 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    When I check the site now in Vantage in iOS Safari there isn’t any more zooming when I click a form field. The screen shifts down to the field and the background and border color changes to white.

  18. 9 years, 2 months ago Darren Clark

    :(

    I’m still getting it.

    Once you focus onto the field the page become horizontally scrollable? The field size increases too…

  19. 9 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    Which operating system and browser are you testing in. Thanks.

  20. 9 years, 2 months ago Darren Clark

    iPhone 6
    iOS 8.3 (12F70)

    Chrome version 43.0.2357.61
    Safari version (packaged with the above iOS version)

    Screen grabs:

    https://dl.dropboxusercontent.com/u/13973547/1.png – shows the form field before focus
    https://dl.dropboxusercontent.com/u/13973547/2.png – shows the form field when zoomed upon focus
    https://dl.dropboxusercontent.com/u/13973547/3.png – shows the horizontal scroll available upon field focus

  21. 9 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    Awesome, thanks for clearing that up.

    The problem is originating from your Custom CSS. If you developed the Custom CSS section please could you take a look at the focus pseudo classes in use. Something in this area here:

    input[type=text],
    input[type=email],
    textarea {
      border: 3px solid #6288be;
      border-radius: 10px;
      background-color: #1e55a2;
      padding: 15px;
      color: #ffffff!important;
      font-size: 1em;
    }
    
    input:focus,
    textarea:focus {
      outline: none;
      background-color: #ffffff;
      color: #1e55a2!important;
      border-color: #ffffff;
    }
    
  22. 9 years, 2 months ago Darren Clark

    Hi Andrew,

    I tried removing these styles (along with numerous other styles affecting this element) to no avail…

    :(

  23. 9 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    Quick test for us: Remove everything in Custom CSS just temporarily. Test on mobile. Let me know the result. Thanks.

  24. 9 years, 2 months ago Darren Clark

    All custom CSS removed, issue still prevails…

    I’ll leave the CSS off so that you can see it.

  25. 9 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    I see it. I’m almost certain this is a core iOS feature. It can be tough rolling back these kinds of core user interface features. If you have a moment please also hit Google for us and see what you come up with. I’ve been looking but am open to suggestions.

  26. 9 years, 2 months ago Darren Clark

    Google’s search bar stays the same width, but the page still has the ability to drag (i.e. horizontal scroll).

    Where as if you go to the BBC’s website on mobile (thus m.bbc.co.uk) and hit their search bar, the page doesn’t zoom, no horizontal scroll, nothing…

    It’s something that i’ve managed to prevent previously when building sites from scratch, but this is the first time i’ve ‘customised’ a WP theme and the ‘problem’ is seemingly difficult to resolve!

  27. 9 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    Apologies for the hassle. I’m removing the original action in our child theme meta viewport before it’s been hooked. The result is our new viewport is being placed before the original, therefore not working.

    After the opening PHP tag let’s replace the entire contents of functions.php (child theme) with the following:

    /**
     * Enqueue the parent theme stylesheet.
     */
    function vantage_child_enqueue_parent_style() {
        wp_enqueue_style( 'vantage-parent-style', get_template_directory_uri() . '/style.css' );
    }
    add_action( 'wp_enqueue_scripts', 'vantage_child_enqueue_parent_style', 8 );
    
    function vantage_child_theme_setup() {
        remove_action( 'wp_head', 'vantage_responsive_header' );
    }
    add_action( 'after_setup_theme', 'vantage_child_theme_setup' );
    
    /**
     * Add the responsive header
     */
    function vantage_child_responsive_header() {
    	?><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /><?php
    }
    add_action( 'wp_head', 'vantage_child_responsive_header' );
    

    Hoping this works :)

  28. 9 years, 2 months ago Darren Clark

    Did someone say, HIGH FIVE!

    Yes, nailed it!

    Going forward will this be included as an option on future updates to the main Vantage theme – or will my client have to stick with the child theme from now on?

  29. 9 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    Awesome! Win!

    Sorry I didn’t catch the child theme mistake earlier.

    I’ll need to chat to Greg about the current viewport and what he’d like to do with that. There might be a reason he stuck with the one you had before.

    I’d recommend sticking with the child theme because if you ever need to introduce a theme file code edit in the future you’ll have the child theme ready and won’t have to redo any Customize options.

    Thanks for your patience on this!

    Cheers for now.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More