-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fixed viewport meta-tags #2084
Fixed viewport meta-tags #2084
Conversation
# -3 for the meta charset, http-equiv and viewport. | ||
assert len(meta) == 3, "Should have 3 meta tags" | ||
|
||
viewport_meta = meta[2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better not to depend on the order of the returned meta elements. Also if we add more default meta tags in the future this test would need to change. Instead, find just the viewport tags and ensure there's exactly one:
meta = dash_duo.find_elements('meta[name="viewport"]')
@@ -133,6 +133,29 @@ def test_inin007_meta_tags(dash_duo): | |||
assert meta_tag.get_attribute("content") == meta_info["content"] | |||
|
|||
|
|||
def test_inin007b_change_viewport_meta_tag(dash_duo): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather we not squeeze test numbers in between with b
or such - makes it harder to run just one test with eg pytest -k inin007
. Just shift some of the other test numbers so this one can have its own. Maybe the ones up front since this file starts at inin004
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💃 Excellent!
In dash 2.5.0, a default viewport meta tag was added as recommended for mobile-optimized sites by mdn.
This PR makes it so that this feature can be disabled by providing an empty viewport meta tag.
e.g.
app = Dash(meta_tags=[{"name": "viewport"}])
Contributor Checklist
CHANGELOG.md