Reply doesn't clear the edit post text if clicked after Edit

AI-generated summary

A bug has been identified where clicking “Reply” after editing a post does not clear the edit post text. dandv describes the issue and provides a GIF to illustrate it. sam confirms this is a regression, while codinghorror believes this was never handled properly.

tgxworld investigated the issue, finding additional “bugs” and created a PR (#3649) to address them. These include:

  • Clicking reply, adding text, and then editing a post without clearing the composer
  • Clicking reply, adding text, hiding the composer, and then editing a post, which shows the composer as a reply
  • A potential bug where clicking edit on one post, updating the text, and then clicking edit on another post does not trigger the composer

After a follow-up PR (#3691), tgxworld suggests closing the issue, thanking @zogstrip for reviewing.

  1. Edit your own post
  2. Click “Reply” to it.

Note how the contents of the post edit textarea isn’t cleared for the reply.

Executon in the other order, Reply then Edit, works correctly.

إعجاب واحد (1)

Yeah its a regression, in the past we used to display “are you sure you want to stop editing” or something like that.

I don’t think we ever did handle this, actually – I thought you opened a bug on this.

Ok so I looked into this and discovered a few more “bugs” which I included the fix in the PR.

  1. Click reply, Add some text, Click edit, Nothing happens.

  2. Click reply, Add some text, hide the composer, Click edit, Composer shows up as Reply.

  3. Not fixed yet and I’m not sure if this is considered a bug Click edit, Update the text, Click another post’s edit, Nothing happens.

cc @eviltrout since you wrote most of the composer’s code.

4 إعجابات

Excellent, thanks for following up on these!

إعجابَين (2)

One more PR before we can close this :smile:

https://github.com/discourse/discourse/pull/3691

3 إعجابات

@zogstrip Thanks for reviewing :smile: Lets close this? :cat:

إعجابَين (2)