message_edit: Fix stale syntax upon cancelling upload in preview.

Previously, canceling an upload in preview mode &
returning to editing left the syntax unchanged
(e.g., still showing "Uploading"). This happened
because the `replaceFieldText` function does not
work when the text area's display is none.

To fix this, instead of hiding the textarea in
preview mode, we use a grid to overlap it with
the preview container. This is the same thing we
are doing in the compose box. We have also added
css to ensure the textarea remains hidden behind
the transparent preview container
in preview mode.
This commit is contained in:
ubaidrmn
2025-03-18 03:04:02 +05:00
committed by Tim Abbott
parent 01c5197dd9
commit 382a828eec
3 changed files with 15 additions and 3 deletions

View File

@@ -1806,4 +1806,15 @@ textarea.new_message_textarea {
pointer-events: none;
}
}
.message-edit-textbox {
/* In preview mode, we hide the message edit
textbox to prevent it from appearing behind
the preview container. We cannot set its
display to none or visibility to hidden, as
that would prevent us from modifying the
textarea's value. */
height: 0;
overflow: hidden;
}
}