mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 23:43:43 +00:00
Prior to commit8b7e70ac27this system would simply just .hide() forms when they were closed and .empty().append() every time it needed to "show_edit". This was not a very clean way of handling the action of canceling an edit, so8b7e70ac27introduced a change that had the "show_edit" function append the form and the "hide" function .empty() the form. However, we overlooked the fact that the user could use browser history to navigate away and back to the form and use "e" or "left arrow key" to successfully append another form and get to an ugly, broken state. This commit does not revert8b7e70ac27as it is still accurate to .empty() when hiding the form, but we add an early exit if a form already exists, to avoid bugs like the above. Using an early exit instead of eg .empty().append() ensures that the user doesn't accidentally lose the entire content of an edit, if they deselect the input box and press `e`. Fixes: #15045.
14 KiB
14 KiB