mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user