From ceb29d3eeacbddb3c7eb3659ccb47434c0c7e33b Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Wed, 2 Oct 2019 12:36:11 -0400 Subject: [PATCH] UX: Full viewport composer layout on iPad Partially reverts 94ab48c by using Safari hacks on iPad again. This brings parity in the composer UI between iPhones and iPads Hides grippie and fullscreen toggle button when the keyboard is visible on iPads --- .../discourse/lib/safari-hacks.js.es6 | 2 +- app/assets/stylesheets/desktop/compose.scss | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/discourse/lib/safari-hacks.js.es6 b/app/assets/javascripts/discourse/lib/safari-hacks.js.es6 index 644fa2c4361..e221afa4647 100644 --- a/app/assets/javascripts/discourse/lib/safari-hacks.js.es6 +++ b/app/assets/javascripts/discourse/lib/safari-hacks.js.es6 @@ -75,7 +75,7 @@ export function isWorkaroundActive() { function positioningWorkaround($fixedElement) { const caps = Discourse.__container__.lookup("capabilities:main"); - if (!caps.isIOS || caps.isIpadOS || safariHacksDisabled()) { + if (!caps.isIOS || safariHacksDisabled()) { return; } diff --git a/app/assets/stylesheets/desktop/compose.scss b/app/assets/stylesheets/desktop/compose.scss index 386f7b44eb5..b047169df79 100644 --- a/app/assets/stylesheets/desktop/compose.scss +++ b/app/assets/stylesheets/desktop/compose.scss @@ -230,6 +230,16 @@ a.toggle-preview { text-align: right; } +html.keyboard-visible { + .grippie, + &:not(.fullscreen-composer) .toggle-fullscreen { + display: none; + } + #reply-control.open { + height: calc(var(--composer-vh, 1vh) * 100); + } +} + // fullscreen composer styles .fullscreen-composer { overflow: hidden; @@ -282,9 +292,3 @@ a.toggle-preview { } } } - -.fullscreen-composer.keyboard-visible { - #reply-control.fullscreen { - top: 0px; - } -}