Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjustLinkSelection does not select whole link #2804

Closed
jdhuntington opened this issue Sep 19, 2024 · 1 comment
Closed

adjustLinkSelection does not select whole link #2804

jdhuntington opened this issue Sep 19, 2024 · 1 comment
Assignees

Comments

@jdhuntington
Copy link

Describe the bug
When editing an existing link using adjustLinkSelection where the link has multiple words (eg <a href="#">foo bar baz</a>), only a single word will be returned when the cursor is on bar and no selection exists.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://microsoft.github.io/roosterjs/index.html
  2. Type "this is a test foo bar baz"
  3. Highlight "foo bar baz"
  4. Click the ribbon icon to insert a link
  5. Keep "foo bar baz" as "Display as", pick anything for the URL (eg #)
  6. Click "ok"
  7. Clear the selection
  8. Put the cursor in the middle of "baz" (which is now part of a link)
  9. Click "Insert link" again
  10. Notice "Display as" contains only "baz"

Expected behavior
In the final step, "Display as" should contain "foo bar baz"

Screenshots
Screenshot 2024-09-19 at 11 07 32 AM
Screenshot 2024-09-19 at 11 07 46 AM
Screenshot 2024-09-19 at 11 08 47 AM
Screenshot 2024-09-19 at 11 10 39 AM
Screenshot 2024-09-19 at 11 10 43 AM

Device Information
macOS, firefox (evergreen)

@JiuqingSong
Copy link
Collaborator

Thanks, I can repro.

@JiuqingSong JiuqingSong self-assigned this Sep 23, 2024
JiuqingSong added a commit that referenced this issue Oct 4, 2024
BryanValverdeU added a commit that referenced this issue Oct 11, 2024
* Add a ID to the TempDiv, to be able to identify on blur was caused for copy/cut #2813

* delete image range

* remove selection

* fix build

* WIP

* clean info when delete image

* WIP

* WIP

* add unit tests

* nit

* Remove style "white-space" from empty paragraph (#2820)

* Remove white-space style for empty paragraph

* improve

* Fix #2804 (#2821)

* touch images

* Do not treat image without src as empty image (#2823)

* update versions.json

* update versions

---------

Co-authored-by: Julia Roldi (from Dev Box) <juliaroldi@microsoft.com>
Co-authored-by: Julia Roldi <87443959+juliaroldi@users.noreply.github.com>
Co-authored-by: Jiuqing Song <jisong@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants