Skip to content

Commit b5c84c8

Browse files
committed
fix(debug): resize viewport with onscreen keyboard
This is a very similar change to nextcloud/richdocuments#5137, which resized our iframe when we opened the onscreen keyboard. This does the same change for all our viewport specifiers (although I note that the cool.html.m4 change will have no effect for integrators since as this option has no effect when used in an iframe...) Not finding some way to resize the content when the keyboard is popped up has the following undesireable effects: - Focusing the hidden input causes the page to shift up and down on some devices as not all of it fits on the screen at once and some browsers want to keep the hidden input "in view" - #13274 is ineffective, as you can't detect the height of the screen properly - The bottom toolbar is almost always hidden behind the keyboard (in portrait or landscape) Signed-off-by: Skyler Grey <[email protected]> Change-Id: I4d5a0c09c2130f92a0711ad731cad9e96a6a6964
1 parent b993c31 commit b5c84c8

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

browser/html/cool.html.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ m4_ifelse(IOSAPP,[true],
3131
<meta charset="utf-8">
3232
m4_ifelse(MOBILEAPP, [true],
3333
[
34-
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
34+
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, interactive-widget=resizes-content">
3535
],
3636
[
3737
%BROWSER_VIEWPORT%

browser/html/debug.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6-
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
6+
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, interactive-widget=resizes-content">
77
<title>Online</title>
88
<style>
99
html, body, iframe

browser/html/wasm.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<head>
55
<meta charset="UTF-8">
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7-
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
7+
<meta name="viewport"content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, interactive-widget=resizes-content">
88
<title>Online</title>
99
<style>
1010
html,

test/FileServeWhiteBoxTests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ void FileServeTests::testPreProcessedFile()
303303
<html %UI_RTL_SETTINGS% style="height:100%"><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8">
304304
<title>Online Editor</title>
305305
<meta charset="utf-8">
306-
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
306+
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, interactive-widget=resizes-content">
307307
308308
<script>
309309

wsd/FileServer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ using Poco::Util::Application;
8484
// We have files that are at least 2.5 MB already.
8585
// WASM files are in the order of 30 MB, however,
8686
constexpr auto MaxFileSizeToCacheInBytes = 50 * 1024 * 1024;
87-
constexpr std::string_view MetaViewPort = "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, minimum-scale=1\">";
87+
constexpr std::string_view MetaViewPort = "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, minimum-scale=1, interactive-widget=resizes-content\">";
8888

8989
namespace
9090
{

0 commit comments

Comments
 (0)