Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Incorrect selection index after setting an HTML text #818

Closed
alfogrillo opened this issue Sep 19, 2023 · 2 comments
Closed

Incorrect selection index after setting an HTML text #818

alfogrillo opened this issue Sep 19, 2023 · 2 comments

Comments

@alfogrillo
Copy link
Contributor

alfogrillo commented Sep 19, 2023

Steps to reproduce

  • Call setContentFromHtml on the composer model with the string <p><strong>rteoff</strong></p>\n
  • Observe the related textUpdate generated by the update.
    • It's a replaceAll
    • Code units: 38 values
    • start: 8
    • end: 8
  • The parsed text by HTML is rteoff\n (7 characters)
  • Observe the start and the end indexes are two positions after the last valid index (which is 6)
  • Observe that model.getContentAsPlainText() is equal to rteoff\n\n (two trailing \n)

Expectation

  • The start and end index in the replaceAll update is equal to 7 (the first index after the text set in the model)
  • The model.getContentAsPlainText() is equal to rteoff\n
@alfogrillo
Copy link
Contributor Author

alfogrillo commented Sep 19, 2023

Workaround for iOS -> #817

@alfogrillo
Copy link
Contributor Author

Fixed by #820

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant