I have a page that I need to reset the viewport scale (the pinch zoom) on command, setting it back to the initial zoomed out state.
Looks like the old tried and true method of rewriting the meta viewport:
const viewportmeta = document.querySelector('meta[name="viewport"]');
viewport.attr('content', "initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0");
doesn't seem to have any effect anymore on ios10 (page remains zoomed in). Is there any way around this?
Update
.attr is a jquery method, my mistake for leaving that in the original question (supposed to be setAttribute I was trying a bunch of different things to make this work). The issue still stands though. I've built a demo page here.
On iOS 10+ zoom in really far, like this:
Changing the viewport when you've zoomed past device width doesn't zoom back out when viewport meta tag is changed. This does work on android (at least in the chrome browser).
font-size: 16px;
to the tagsbody
and my input field, I prevented iOS from auto-zooming in the first place. – Magnus