FIX: Bug when scrolling in iOS Safari with composer open (#12831)

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.

diff --git a/app/assets/javascripts/discourse/app/components/composer-body.js b/app/assets/javascripts/discourse/app/components/composer-body.js
index 0dfa7c3..0879ffe 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");
 

GitHub sha: 886f4b58

This commit appears in #12831 which was approved by CvX. It was merged by pmusaraj.

This commit has been mentioned on Discourse Meta. There might be relevant details there: