wordpress-mobile / AztecEditor-Android

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

Implement backspace soft override #1033

Closed planarvoid closed 1 year ago

planarvoid commented 1 year ago

Fix

In this PR I'm adding an option to override the backspace on the soft keyboard. This is useful if you want to show a dialog instead of deleting a certain item (like an image).

In order to test it you have to:

Test 1

  1. Do the initial steps
  2. Click right behind the placeholder image
  3. Click on "Backspace"
  4. Notice the image is not deleted

Test 2

  1. Do the initial steps
  2. Click at the beginning of the next line behind the image
  3. Click on "Backspace"
  4. Notice the image is not deleted

Test 3

  1. Do the initial steps
  2. Click anywhere that's not right behind the image
  3. Try backspace
  4. Notice the text is deleted as expected

Review

@khaykov

Make sure strings will be translated:

planarvoid commented 1 year ago

Thanks for testing @khaykov ! I think both of these are kind of ok. If the user taps a lot of times, I think it's fine to just let it pass. We'll also show a dialog in the DO app so I think this will not happen IRL. This is a nice-to-have feature so I think it's also OK if it doesn't work on some devices

khaykov commented 1 year ago

Got it 👍 Then it's :shipit: