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

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

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
Contributor

Thanks, I can repro.

@JiuqingSong JiuqingSong self-assigned this Sep 23, 2024
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