You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Summary
Closes#757
There were two issues with `setLink` on web:
- the text serialization was inconsistent with what `onChangeSelection`
returned
- when `text=""`, the method was no-op, whereas on mobile it removes the
text (what we want)
Fix addresses both issues.
Added e2e tests for the first serialization related issue.
Added a temporary button in `example-web` app, so you can see what
happens when you call `setLink` with `text=""`. This will be reverted
before the PR's merge.
## Test Plan
Experiment with `setLink` across paragraph bounds and the
`setLink(text="")` button.
## Screenshots / Videos
Before:
The serialization differed, so `setLink` falsely assumed that `text` it
got as an argument, differs from the actual text in the editor. This
caused a path, where the content would get forcifully replaced with that
"falsely new" `text`, which caused paragraphs to drop, and a literal
`\n` to get inserted. It visually looks fine, but HTML proves the
incorrectness.
https://github.com/user-attachments/assets/c54443bb-54d7-4525-a5bd-83cab884ebef
After:
https://github.com/user-attachments/assets/99ee4812-7b5f-439b-b708-26661b46c8c2
## Compatibility
| OS | Implemented |
| ------- | :---------: |
| iOS | ❌ |
| Android | ❌ |
| Web | ✅ |
## Checklist
- [x] E2E tests are passing
- [x] Required E2E tests have been added (if applicable)
0 commit comments