Skip to content

Conversation

@Twinsen81
Copy link
Contributor

@Twinsen81 Twinsen81 commented Jun 12, 2025

Fix

The AztecText.setOnSelectionChangedListener wasn't working from the client side, as the editor's internal code was overriding the listener for its purposes. Refactored the code to allow multiple listeners.

Test

  • Check out the plokhoves/fix-selection-listener branch in AS
  • Run the app
  • Type some text in the editor
  • Select a word and apply the bold style
  • Observe that the selected text is displayed in bold
  • Tap the selection handles and move them to select more or less text
  • Observe that the bold icon on the toolbar changes the color to black when only the bolded text is selected
Screen_recording_20250612_102632.mp4

Review

@mzorz

@Twinsen81 Twinsen81 added the bug label Jun 12, 2025
Copy link
Contributor

@mzorz mzorz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition of the interface so we can expose the listeners 👍

I wonder if the listeners could mess up with each other in certain occasions, nothing becomes apparent right now on the demo app, but could it happen that a listener has access to the editor and changes the text somehow and as such the other listeners would no longer have valid data. Perhaps we could "block" changes from within a listener 🤔 - but beyond the scope of this change for sure, just leaving it here as a thought.

LGTM :shipit:

@Twinsen81 Twinsen81 merged commit b19d733 into trunk Jun 13, 2025
11 of 15 checks passed
@Twinsen81 Twinsen81 deleted the plokhoves/fix-selection-listener branch June 13, 2025 08:49
@sentry
Copy link

sentry bot commented Jun 13, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants