From 886f4b589e87e55d8b364c503d495ac62f235a3b Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Sun, 25 Apr 2021 22:14:13 -0400 Subject: [PATCH] FIX: Bug when scrolling in iOS Safari with composer open (#12831) Regression was introduced in c54609. This ensures the full height composer styling only applies when (window height - viewport height > 0). Previously it was being wrongly triggered when that calculation returned a negative number. --- .../javascripts/discourse/app/components/composer-body.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/app/components/composer-body.js b/app/assets/javascripts/discourse/app/components/composer-body.js index 0dfa7c3b221..0879ffef2f1 100644 --- a/app/assets/javascripts/discourse/app/components/composer-body.js +++ b/app/assets/javascripts/discourse/app/components/composer-body.js @@ -164,7 +164,7 @@ export default Component.extend(KeyEnterEscape, { const viewportWindowDiff = this.windowInnerHeight - window.visualViewport.height; - viewportWindowDiff + viewportWindowDiff > 0 ? doc.classList.add("keyboard-visible") : doc.classList.remove("keyboard-visible");