wordpress-mobile / AztecEditor-Android

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

Stop using custom getLineForOffset #988

Closed planarvoid closed 1 year ago

planarvoid commented 1 year ago

Fix

There is an issue where there is a multiline text element before a placeholder. The custom method that was calculating line for offset doesn't take that into account. I've replaced it with the default getLineForOffset and it seems to work well now.

In addition to this I've also made some of the functions in the PlaceholderManager suspended to improve performance and allow async computation

Test

  1. Enable placeholders and add a multiline text followed by a placeholder to the Example field
  2. Run the app
  3. Notice the placeholder is drawn correctly

Review

@danilo04

Make sure strings will be translated: