Allow viewport scaling (zooming) of frontend#6157
Allow viewport scaling (zooming) of frontend#6157davidjb wants to merge 1 commit intohome-assistant:devfrom davidjb:allow-zooming
Conversation
The inclusion of the `user-scalable=no` value in the viewport meta tag prevented viewport scaling, disabling the ability to zoom the webpage. This most typically affects mobile devices, given the nature of the `<meta name="viewport">` tag. Removing the restriction allows a user to zoom in to see small and fine detail in the UI -- such as zooming in on particular areas of a home security camera streams or other images, inspecting detail in state and other graphs, and so on. For users with accessibility requirements, such as low vision conditions, being able to zoom the frontend means they can enlarge UI elements to suit them (MDN explains several accessibility concerns at https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name#Accessibility_concerns_with_viewport_scaling) This change has no effect on users that choose not to use it (for example, only those that engage zooming such as via pinch-to-zoom on mobile devices will see the change) -- the frontend remains the same otherwise. Elements of the frontend that do use pinch-to-zoom (e.g. the Map) continue to work as expected, with pinches on that screen area being captured by the map.
|
@balloob would there be an objection for this? Not sure if this was added for a reason? |
| @@ -1,4 +1,4 @@ | |||
| <meta name='viewport' content='width=device-width, user-scalable=no'> | |||
| <meta name='viewport' content='width=device-width'> | |||
There was a problem hiding this comment.
I see the header doesn't deal with this very well, but other than that it seems to work ok...
There was a problem hiding this comment.
Seems to work okay for me; I've been using this in my HA install for several months.
|
We have this tag because we behave like a mobile app. We're not a normal website. Just like you can't zoom in when using sms etc. I think that removing this tag also has impact on how windows are initially sized |
|
Closing this as it has gone stale |
|
@bramkragten Would me reopening this PR be worthwhile? As mentioned in my comment above, I've been using this change since before opening the PR and had no issues to date. I understand that Home Assistant may not be considered a normal website, but it is a web-based platform and should aim to be accessible. As I mentioned in my original PR, https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name#Accessibility_concerns_with_viewport_scaling explains the various benefits of allowing viewport scaling and is echoed by Google's web.dev reference at https://web.dev/meta-viewport/, which includes it as part of PWA success criteria. |
|
I think this could also cause problems with double clicking actions zooming the page? I'm personally not agains this if it doesn't break anything, Safari already ignores this tag. |
|
@bramkragten So with the PR applied (aka Other platforms' behaviour will vary, but this will already be the case given differences in support for the non-standard tag (apparently certain versions of Android require the value set as I'll re-open the PR in that case? |
Breaking change
I don't believe this is a breaking change but as
user-scalableis a defacto standard, there may be some device out there that behaves strangely. As mentioned below, it should only affect users who are zooming the UI, a new 'feature' since it wasn't possible before.Proposed change
The inclusion of the
user-scalable=novalue in the viewport meta tagprevented viewport scaling, disabling the ability to zoom the webpage.
This most typically affects mobile devices, given the nature of the
<meta name="viewport">tag.Removing the restriction allows a user to zoom in to see small and fine
detail in the UI -- such as zooming in on particular areas of a home
security camera streams or other images, inspecting detail in state and
other graphs, and so on.
For users with accessibility requirements, such as low vision
conditions, being able to zoom the frontend means they can enlarge UI
elements to suit them (MDN explains several accessibility concerns at
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name#Accessibility_concerns_with_viewport_scaling)
This change has no effect on users that choose not to use it (for
example, only those that engage zooming such as via pinch-to-zoom on
mobile devices will see the change) -- the frontend remains the same
otherwise. Elements of the frontend that do use pinch-to-zoom (e.g. the
Map) continue to work as expected, with pinches on that screen area
being captured by the map.
Type of change
Example configuration
N/A
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: