diff --git a/app/assets/javascripts/discourse/app/controllers/composer.js b/app/assets/javascripts/discourse/app/controllers/composer.js index 77fb3a6e9cf..3e990c07451 100644 --- a/app/assets/javascripts/discourse/app/controllers/composer.js +++ b/app/assets/javascripts/discourse/app/controllers/composer.js @@ -1475,6 +1475,7 @@ export default Controller.extend({ elem.classList.remove("composer-open"); document.activeElement?.blur(); + document.documentElement.style.removeProperty("--composer-height"); this.setProperties({ model: null, lastValidatedAt: null }); }, diff --git a/app/assets/javascripts/discourse/tests/acceptance/composer-test.js b/app/assets/javascripts/discourse/tests/acceptance/composer-test.js index 7659597d4da..2ec16f1854c 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/composer-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/composer-test.js @@ -86,6 +86,14 @@ acceptance("Composer", function (needs) { "400px", "sets --composer-height back to 400px when composer is opened from draft mode" ); + + await fillIn(".d-editor-input", ""); + await click(".toggle-minimize"); + assert.strictEqual( + document.documentElement.style.getPropertyValue("--composer-height"), + "", + "removes --composer-height property when composer is closed" + ); }); test("composer controls", async function (assert) {