FIX: set --composer-height when the composer is in collapsed state (#17968)

This commit is contained in:
Arpit Jalan 2022-08-17 20:51:09 +05:30 committed by GitHub
parent 8626268366
commit 2b43238973
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -107,6 +107,7 @@ export default Component.extend(KeyEnterEscape, {
const minHeight = parseInt(getComputedStyle(this.element).minHeight, 10);
size = Math.max(minHeight, size);
this.set("composer.composerHeight", `${size}px`);
document.documentElement.style.setProperty(
"--composer-height",
size ? `${size}px` : ""

View File

@ -108,6 +108,7 @@ export default Controller.extend({
topic: null,
linkLookup: null,
showPreview: true,
composerHeight: null,
forcePreview: and("site.mobileView", "showPreview"),
whisperOrUnlistTopic: or("isWhispering", "model.unlistTopic"),
categories: alias("site.categoriesList"),
@ -496,6 +497,10 @@ export default Controller.extend({
}
this.set("model.composeState", Composer.OPEN);
document.documentElement.style.setProperty(
"--composer-height",
this.get("model.composerHeight")
);
return true;
}
@ -1274,6 +1279,7 @@ export default Controller.extend({
const defaultComposerHeight =
this.model.action === "reply" ? "300px" : "400px";
this.set("model.composerHeight", defaultComposerHeight);
document.documentElement.style.setProperty(
"--composer-height",
defaultComposerHeight
@ -1488,6 +1494,7 @@ export default Controller.extend({
collapse() {
this._saveDraft();
this.set("model.composeState", Composer.DRAFT);
document.documentElement.style.setProperty("--composer-height", "40px");
},
toggleFullscreen() {