FIX: correctly unshrink composer when re-editing post (#26650)

Prior to this fix we were manually expanding the composer but not setting the correct height. This commit adds a new `unshrink` function on the composer service to correctly set the state and the height on the composer model.
This commit is contained in:
Joffrey JAFFEUX 2024-04-16 14:49:51 +02:00 committed by GitHub
parent 8fbdce36a4
commit 4f7cd7b78e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View File

@ -847,7 +847,7 @@ export default Controller.extend(bufferedProperty("model"), {
opts?.action === Composer.EDIT && opts?.action === Composer.EDIT &&
composerModel?.draftKey === opts.draftKey; composerModel?.draftKey === opts.draftKey;
if (editingExisting) { if (editingExisting) {
composerModel.set("composeState", Composer.OPEN); composer.unshrink();
return; return;
} }

View File

@ -1697,6 +1697,14 @@ export default class ComposerService extends Service {
}); });
} }
unshrink() {
this.model.set("composeState", Composer.OPEN);
document.documentElement.style.setProperty(
"--composer-height",
this.model.composerHeight
);
}
shrink() { shrink() {
if ( if (
this.get("model.replyDirty") || this.get("model.replyDirty") ||