Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover,interactive-widget=resizes-content">
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">

<link rel="manifest" href="/manifest.json">
<!-- Tracks --bg-base. A literal because it is read before any stylesheet. -->
Expand Down Expand Up @@ -56,5 +56,5 @@
</div>
</div>
</dialog>
<script type="module" src="/js/dashboard.js?v=593d93b6"></script>
<script type="module" src="/js/dashboard.js?v=bbd696a6"></script>
</body></html>
6 changes: 6 additions & 0 deletions ui/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ import { THEME_KEY, applyTheme, prefersDark, readMode, resolveTheme } from '/js/

ensureSprite();

if (!('GestureEvent' in window)) {
const viewport = document.querySelector('meta[name="viewport"]');
if (viewport)
viewport.setAttribute('content', `${viewport.getAttribute('content')},interactive-widget=resizes-content`);
}

/* Recomputed, never stored: the window can cross the breakpoint after load. */
let MOB = isMobileLayout();

Expand Down
6 changes: 4 additions & 2 deletions ui/test/spotlight-dismiss.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ test('closing puts both edges back', () => {
assert.match(fn[1], /classList\.remove\('kb'\)/);
});

test('the browser is asked to resize the page for the keyboard', () => {
assert.match(html, /name="viewport"[^>]*interactive-widget=resizes-content/);
test('the browser is asked to resize the page for the keyboard, except where the key is unknown', () => {
assert.doesNotMatch(html, /interactive-widget/, 'Safari logs an error for the key in the page');
const dash = read('js/dashboard.js');
assert.match(dash, /if \(!\('GestureEvent' in window\)\) \{[\s\S]{0,200}interactive-widget=resizes-content/);
});

test('the list drops the status-bar inset once the keyboard has moved it', () => {
Expand Down
Loading