threema-ch / threema-web

The Threema Web application.
GNU Affero General Public License v3.0
984 stars 104 forks source link

Missing placeholder text in compose area when deleting multiple lines #1202

Closed threema-danilo closed 4 months ago

threema-danilo commented 4 months ago

Bug Description

Sometimes the compose doesn't show a placeholder text even though it's empty.

screenshot-20240402-173506

Steps to Reproduce (for bugs)

Firefox:

  1. Type "a<shift+enter>b"
  2. Press ctrl+a to select all text
  3. Press ctrl+x to cut text

Chromium:

  1. Type "a<shift+enter>b"
  2. Press ctrl+a to select all text
  3. Press ctrl+x to cut text
  4. Paste text, and repeat steps 2 and 3

In both situations, the contenteditable div now contains a single <br> which prevents the placeholder from showing up.

Your Environment

threema-danilo commented 4 months ago

Seems like this fix stopped working:

https://github.com/threema-ch/threema-web/blob/82c83c6f4dfbc21b8e787004c306a4be7d699bc2/src/directives/compose_area.ts#L347-L352