wordpress-mobile / AztecEditor-Android

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

Issue/464 missing suggestions #466

Closed 0nko closed 6 years ago

0nko commented 6 years ago

Fixes #464. This brings back #237.

khaykov commented 6 years ago

There is another, a bit more serious side effect of #237 - when you delete the last character of styled text the span is removed from it. Open the app with demo content, put cursor behind "Italic" and press backspace on the software keyboard.

I researched this problem a long time ago, and it is indeed caused by autocorrect/suggestion (the suggested text becomes Underlined and all the other spans are removed from it). That's why we reapplying the spans here. But apparently it did not work :) I'll take a look at #237 - maybe it will be a quick fix.

khaykov commented 6 years ago

Another issue - type some letters, toggle inline style, type some more letters, press space. Notice the inline style disappeared.

0nko commented 6 years ago

Hmm, that's pretty serious. Thanks for pointing that out, Klym.

maxme commented 6 years ago

@khaykov I can't reproduce issues you described. Is this specific to a certain android version or device? I tested on this branch, I used Android 5.0 and 7.0.

khaykov commented 6 years ago

@maxme Yes, those issues are from pre 5.0.0 devices.

From the top of my head here is a couple of issues you can reproduce on 5.0.0+ devices (tested on Pixel_API_25 emulator):

Load empty editor, type "h" toggle bold, type "ello" notice that after you finish typing only the last letter will have a bold style applied to it.

Toggle bold, and type some incorrect word, like "herro", press space so it will be autocorrected to "hero", press backspace to cancel autocorrect and notice that the bold style is also gone.

Also, autocorrect only works with soft keyboard, so make sure to use it.

khaykov commented 6 years ago

Found another issue that I can only reproduce on API 26 so far: Load empty editor, type "a" toggle Bold style, type "b". Put the cursor between "a" and "b" and press space. Notice that "b" became unstyled.

:(

mzorz commented 6 years ago

aztec_horizontal

mzorz commented 6 years ago

Just for the record: this comment https://github.com/wordpress-mobile/AztecEditor-Android/pull/466#issuecomment-344315573 in this PR doesn't block the review/merge.

mzorz commented 6 years ago

@0nko I confirm I can reproduce this issue here https://github.com/wordpress-mobile/AztecEditor-Android/pull/466#issuecomment-338112619

We can merge this one once the conflicts are resolved, going to open new issues with whatever is found (that comment for example, plus the all-content-in-one-line issue from 4.2.2 )

mzorz commented 6 years ago

:shipit: