diff --git a/flow-server/src/main/java/com/vaadin/flow/component/page/Viewport.java b/flow-server/src/main/java/com/vaadin/flow/component/page/Viewport.java
index 97abe9194f8..8b9a29507d9 100644
--- a/flow-server/src/main/java/com/vaadin/flow/component/page/Viewport.java
+++ b/flow-server/src/main/java/com/vaadin/flow/component/page/Viewport.java
@@ -25,7 +25,8 @@
/**
* Defines a viewport tag that will be added to the HTML of the host page of a
* UI class. If no viewport tag has been defined, a default of
- * width=device-width, initial-scale=1.0
is used.
+ * width=device-width, initial-scale=1.0, viewport-fit=cover
is
+ * used.
*
* @author Vaadin Ltd
* @since 1.0
@@ -42,20 +43,20 @@
*
* Recommended for a Responsive Web Design. */ - String DEFAULT = "width=device-width, initial-scale=1.0"; + String DEFAULT = "width=device-width, initial-scale=1.0, viewport-fit=cover"; /** * Sets the viewport to the height of the device rather than the rendered * space. */ - String DEVICE_HEIGHT = "height=device-height, initial-scale=1.0"; + String DEVICE_HEIGHT = "height=device-height, initial-scale=1.0, viewport-fit=cover"; /** * Sets the viewport at the width and height of the device. The device-width * and device-height properties are translated to 100vw and 100vh * respectively. */ - String DEVICE_DIMENSIONS = "width=device-width, height=device-height, initial-scale=1.0"; + String DEVICE_DIMENSIONS = "width=device-width, height=device-height, initial-scale=1.0, viewport-fit=cover"; /** * Gets the viewport tag content. diff --git a/flow-tests/test-ccdm/src/test/java/com/vaadin/flow/ccdmtest/IndexHtmlRequestHandlerIT.java b/flow-tests/test-ccdm/src/test/java/com/vaadin/flow/ccdmtest/IndexHtmlRequestHandlerIT.java index 967a87a83bd..d70fbdf1ea2 100644 --- a/flow-tests/test-ccdm/src/test/java/com/vaadin/flow/ccdmtest/IndexHtmlRequestHandlerIT.java +++ b/flow-tests/test-ccdm/src/test/java/com/vaadin/flow/ccdmtest/IndexHtmlRequestHandlerIT.java @@ -53,7 +53,7 @@ public void should_add_appShellAnnotations() { By.cssSelector("meta[name=viewport]")); Assert.assertNotNull(metaViewPort); Assert.assertEquals( - "width=device-width, height=device-height, initial-scale=1.0", + "width=device-width, height=device-height, initial-scale=1.0, viewport-fit=cover", metaViewPort.getAttribute("content")); }