-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow user zoom #1733
Allow user zoom #1733
Conversation
**Purpose:** Update meta viewport attributes to improve accessibility by allowing user zoom. If developers need to limit zoom, they should be able to do so at the theme level. In order to comply with WAI WCAG 2.0 AA accessibility requirements you should never disable pinch zoom: * W3C: http://www.w3.org/TR/mobile-accessibility-mapping/#zoom-magnification * The Accessibility Project: http://a11yproject.com/posts/never-use-maximum-scale/ * Google: https://developers.google.com/web/fundamentals/layouts/rwd-fundamentals/set-the-viewport?hl=en
@chicgeek, thank you for your feedback! However, if you want to allow scaling in your theme, you can do this by using a layout update: <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
</head>
</page> in app\design\frontend\YourVendor\yourThemeName\Magento_Theme\layout\default_head_blocks.xml You can read more about layout updates in our developer docs. |
Inaccessible by default is not a good precedent. If Magento 2 is as successful as Magento 1 with themes based off this default one, there's going to be a lot of websites that cannot zoom just because it was not considered a requirement in the first place. This is bad for those that cannot read tiny fonts. I'd like to see this patch accepted and a layout update provided for those that want to disable zoom (although this is such an anti-pattern it should be discouraged). |
Hi, I agree with @chicgeek here. Disabling a function of a browser that a user will expect to use is bad UX. It's on par with disabling a back button in the browser. |
Personally I think ignoring widely accepted best practices for accessibility is not a good approach. WCAG AA should be a minimum to aim for, otherwise you may be discriminating against disabled (in this case visually impaired) users, and can even potentially expose yourself to legal action (see https://econsultancy.com/blog/8834-rnib-gets-tough-with-bmibaby-over-accessibility/) |
@belbiy I strongly disagree with preventing zoom as a default configuration in Magento. It's a pretty bold move to presume to know more about usability than groups like W3C and Google. In one of the links that @chicgeek provided, Google has this to say about disabling zoom:
Most touch browsers/devices do a great job of only zooming/panning when the user specifically intends to do so, so recreating the "mobile app" experience should not be a concern. On pages like the product listing and product detail pages, allowing a user to pinch-to-zoom will allow them to see more details in the product images. This is especially true if a theme has implemented higher-resolution images using the |
Everyone, thank you for the great feedback here. We definitely will consider this input next time we will re-evaluate the decision on zoom in our themes. For now, the decision has been made, but it doesn't mean it will stay that way. @erikhansen provided a great example when the zoom feature can be really useful for users, and I look forward on implementing responsive images in our themes in similar way. |
@belbiy Ok, thanks for considering the dissenting opinions. I hope that this PR gets merged in soon, as it seems like it is a clear decision. And the longer it stays as it is, the more likely it is that it will never get changed. |
Feel free to ping in a week or two to make sure not forgotten. Lots of internal people (like me) are certainly watching this sort of feedback. I don't claim to be a UX expert, but trying to learn more internally. |
Agreed. Disabiling accessibility should not be the default - I think this is an easy win if it's merged sooner rather than later. I'll ping again in a couple of weeks for reconsideration as requested. Thanks all. |
@chicgeek i have an update already. We decided to allow zoom in the Blank theme, and use XML layout update in Luma theme to disable zoom as i mentioned previously. That way we will keep the current UX for our demo theme, and use recommended viewport settings for a developer starter theme. Again, thanks for the input everyone, keep it up! Internal ticket MAGETWO-42173 |
Merge 2.4-develop into AC-9712
Purpose: Update meta viewport attributes to improve accessibility by allowing user zoom. If developers need to limit zoom, they should be able to do so at the theme level.
In order to comply with WAI WCAG 2.0 AA accessibility requirements you should never disable pinch zoom:
http://www.w3.org/TR/mobile-accessibility-mapping/#zoom-magnification
http://a11yproject.com/posts/never-use-maximum-scale/
https://developers.google.com/web/fundamentals/layouts/rwd-fundamentals/set-the-viewport?hl=en