wordpress-mobile / AztecEditor-Android

A reusable native Android rich text editor component.
Mozilla Public License 2.0
675 stars 112 forks source link

Issue/297 heading menu regression #318

Closed theck13 closed 7 years ago

theck13 commented 7 years ago

Fix

Restores heading menu behavior prior to paragraph spans merge as described in https://github.com/wordpress-mobile/AztecEditor-Android/issues/297. Be aware of the new block formats issue when testing these changes which includes the Reproduced > Menu section in https://github.com/wordpress-mobile/AztecEditor-Android/issues/297. These changes do not address that part of the initial issue https://github.com/wordpress-mobile/AztecEditor-Android/issues/297.

Note

This is blocking the pre tag (i.e. preformat) issue https://github.com/wordpress-mobile/AztecEditor-Android/issues/164.

Test

Heading

  1. Select any text with heading formatted.
  2. Tap Heading format button.
  3. Notice heading format selected.
  4. Tap heading format selected.
  5. Notice heading format is retained.
  6. Tap Heading format button.
  7. Notice heading format selected.
  8. Tap heading format not selected.
  9. Notice heading format is changed.

Paragraph

  1. Select any text with heading formatted.
  2. Tap Heading format button.
  3. Notice heading format selected.
  4. Tap Paragraph format.
  5. Notice heading format is removed.
0nko commented 7 years ago

I found some weird behavior:

  1. Open the demo text
  2. Click on the "Bold" word
  3. Apply "Heading 3" style
  4. Select the heading menu again
  5. Notice it says "Heading 6" is selected
theck13 commented 7 years ago

That's expected. It's picking up the Heading 6 format from the previous line. It's related to and should be addressed in the new block formats issue.

0nko commented 7 years ago

The previous issue was fixed, but now when I tap on a regular text, apply one of the headings and then tap on the heading menu again, the paragraph style is incorrectly selected.

theck13 commented 7 years ago

Were you selecting text containing any other formatting? I can't reproduce that behavior when applying a heading to completely unformatted text. The heading menu must be parsing the inline formatting after the heading formatting and the paragraph item is checked consequently.

0nko commented 7 years ago

It happens when try it with "Underline" or "Italic" of the demo text.

theck13 commented 7 years ago

That should be fixed with 0f826f12ef6644ecaf3c3297c4724329b5f1e168.

0nko commented 7 years ago

The heading menu still selects the wrong thing:

  1. Tap on one of the headings
  2. Open the heading menu
  3. Dismiss it
  4. Scroll down to "aaa" at the bottom
  5. Select the word
  6. Open the heading menu
  7. Notice one of the heading's selected
0nko commented 7 years ago

:shipit: