Cursor Does Not Follow Undo/Redo Position When Undoing/Redoing
Expected
Cursor follows undo/redo position when performing undoing/redoing by tapping the Undo/Redo actions.
Observed
Cursor does not follow undo/redo position when performing undoing/redoing actions as described in https://github.com/wordpress-mobile/AztecEditor-Android/issues/275#issuecomment-283705319 and https://github.com/wordpress-mobile/WordPress-Android/pull/5428#issuecomment-287557658.
Reproduced
- Clear text from demonstration app.
- Type "hello" text.
- Tap Undo thrice.
- Notice cursor is after "e" as expected.
- Tap Redo thrice.
- Notice cursor remains after "e" rather than the end.
- Clear text from demonstration app.
- Type "hello" text.
- Tap Enter key.
- Type "world" text.
- Place cursor after "o" in "hello" text.
- Type "goodbye" text.
- Tap Undo seven times.
- Notice cursor is after "d" in "world" text.
- Tap Redo seven times.
- Notice cursor is between "y" and "e" in "goodbye" text.
Tested
Google Pixel on Android 7.1.2 with AztecDemo 1.0
Another symptom here is that the cursor seems to get lost entirely if there's an image in the body. Here it leaves the keyboard open, but text isn't actually being entered anywhere:

Thanks for reporting @hoverduck , I think that one is actually a different issue. Opened up https://github.com/wordpress-mobile/AztecEditor-Android/issues/700 to track it.