Open Bug 1715076 Opened 3 years ago Updated 2 years ago

Body paragraph state after select-all followed by a delete or replacement

Categories

(Thunderbird :: Message Compose Window, defect)

Thunderbird 91
defect

Tracking

(Not tracked)

People

(Reporter: henry-x, Unassigned)

Details

Steps to reproduce

  1. Start a new HTML composition, in paragraph mode.
  2. Focus the message, and optionally add some text.
  3. Ctrl-A or context menu "Select All" to select all (even if empty).
  4. Replace the selection (press any printable key, or press Delete, or press Backspace, or paste non-formatted text, or cut).

Also produces:

  1. Focus the message, type some text which includes pressing Enter at least once to create more than one paragraph.
  2. Use a mouse drag to select all.
  3. Replace the selection.

Also produces:

  1. Focus the message, and optionally add some text.
  2. Place cursor at the start/end or the start of the message.
  3. Press the Delete/Backspace key until all the text is first gone.
  4. Press the key one more time.

Result

The message block becomes a plain <body>, instead of lying within a <p>. In the first two steps to reproduce, the paragraph state selector shows "Body" instead of the previous "Paragraph". In the last one, it will not be immediately revealed, but pressing another key will show the "Body" state.

Problem

The paragraph state changing is inconsistent with the case where there is only a single paragraph, and the user selects all the text with a mouse drag. In that case the paragraph state remains the same. Its also inconsistent with the case where the user follows the last "Steps to Reproduce" but stops at step 4.

It seems that the "Select All" also captures the surrounding <p> and deletes it, without replacing it again. And pressing Delete or Backspace in an empty <p> deletes it.

The bug isn't particularly severe because as far as I'm aware the message will look the same when we use a body format block or a single paragraph. And the paragraph state is restored if the user presses Enter without Shift. Its just a little bit quirky at the moment, when we could be a bit cleverer about setting the format block.

You need to log in before you can comment on or make changes to this bug.