-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backspace does not outdent nested list item on android #1027
Backspace does not outdent nested list item on android #1027
Comments
One approach to implement outdent behavior for Android is to follow the implementation used for iOS which emits the [Backspace] event to JS, delegating the nested list item behavior to I began implementing this on Android, however, the changes are non-trivial to implement. On Android, the logic determining whether or not to emit a [Backspace] event to JS is conditioned in several places, across several projects / repositories. Here is the line that emits the event to JS. Here are the places which currently condition on this: When the caret is at the beginning of the block with no selection: When the and: When the content is either empty, or equal to the empty html tag for the current block type: Also, the interface method will not be called from Aztec unless several conditions are met within the It would be nice to have many (or all) of these conditions in one place, however, refactoring to accomplish that may require a good deal of time / care to ensure that the changes do not cause regressions in other areas. I have pushed some experimental branches to begin the process of exploring what changes would be necessary: https://github.com/wordpress-mobile/AztecEditor-Android/tree/experimental/fix-backspace-outdent-on-nested-lists The current state of these branches does fix the outdent issue, however, may result in other regressions. With some effort, there may be a way to refactor the conditions to selectively alter the behavior only for nested lists, and I suspect this should also involve extensive testing to prevent regressions in Aztec. 👋 @daniloercoli @hypest wdyt? |
I've the fear that the current Android behaviour will bite us in the near future, when other blocks will be ported to mobile gb. I think we can migrate much of the GB.mobile logic to the wrapper, and keep in Aztec the bare minimum of it. (Consider that Backspace.key detection is also used in Aztec to remove styles). I can take a deeper look tomorrow, and assign this issue to me. |
@mchowning when you work on Aztec for mentions to support the @ detection you probably can also check if it's possible to send the backspace press on other situations? |
Confirmed that this was fixed somewhere down the line! 🎉 I tested using a Pixel 6 and the latest version (24.1) and a backspace worked to outdent a nested list item. |
Description:
Pressing backspace when the caret is at the beginning of a nested list item does not "outdent" the list item. Rather, it merges the list item to the preceding list item.
Steps to reproduce:
Expected behavior:
The indented list item should outdent one level with each press of [Backspace], and only merge with the preceding item after it is fully outdented.
Screencast:
Actual behavior:
The indented list item immediately merges with the preceding list item.
Screencast:
The text was updated successfully, but these errors were encountered: