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

Double-click on link opens empty link dialog due to bug in getSelectedLink #859

Closed
MichaelRoosz opened this issue Sep 1, 2017 · 5 comments
Labels
regression This issue is a regression. status:confirmed An issue confirmed by the development team. target:minor Any docs related issue that can be merged into a master or major branch. type:bug A bug.
Milestone

Comments

@MichaelRoosz
Copy link

MichaelRoosz commented Sep 1, 2017

Are you reporting a feature request or a bug?

Bug

Provide detailed reproduction steps (if any)

  1. Open CKEditor sample, eg. from cdn.
  2. Switch editor to source mode.
  3. Insert into editor:
    <p><a class="linkClass" href="https://www.google.pl"><img src="http://lorempixel.com/10/20/" /> some button text </a></p>
  4. Switch back to WYSIWYG mode.
  5. Double-click on some button text

Expected result

The link dialog should show with proper link data. Check especially:

  • "URL" field in "Link Info" tab (it should contains "https://www.google.pl"),
  • "Stylesheet Classes" field in "Advanced" tab (it should contains "linkClass").

Actual result

The link dialog does not have data described above.

Other details

What I found out so far:

  • getSelectedLink (editor, false) works
  • on right-click selection.getSelectedElement() is null, but when I double-click it points to the correct a
  • on right-click range.getCommonAncestor() points to the some button text, on double-click range.getCommonAncestor() points to the p tag <<<< this causes the problem in my opinion.
  • Browser: Chrome
  • OS: Windows
  • CKEditor version: 4.7.2
MichaelRoosz pushed a commit to MichaelRoosz/ckeditor-dev that referenced this issue Sep 1, 2017
@MichaelRoosz
Copy link
Author

This fix works for me.

@wojtekw92 wojtekw92 added type:bug A bug. status:confirmed An issue confirmed by the development team. labels Sep 4, 2017
@wojtekw92 wojtekw92 self-assigned this Sep 4, 2017
@wojtekw92 wojtekw92 added the regression This issue is a regression. label Sep 4, 2017
@wojtekw92
Copy link
Contributor

regression since 4.7.0

@wojtekw92 wojtekw92 removed their assignment Sep 4, 2017
@mlewand mlewand added the target:minor Any docs related issue that can be merged into a master or major branch. label Sep 12, 2017
@wojtekw92 wojtekw92 self-assigned this Sep 13, 2017
@mlewand
Copy link
Contributor

mlewand commented Sep 19, 2017

I have created a quick unit test for that: https://gist.github.com/mlewand/4b61bbd8540de0b1ecc00e0c99e12404

@lslowikowska
Copy link

lslowikowska commented Jan 19, 2018

Hey @MichaelHeerklotz just to let you know, the fix has been merged into the master branch - we have just decided to skip the minor release (4.8.1) and go straight to 4.9.0, which means that this fix will be released with 4.9.0, too (check the milestones page).

If you can't wait for it, you can download the nightly release from the "CKEditor Nightly Build" section on our download page. Keep in mind, however, that it has not been verified by our integration testing phase yet as we will do this right before the release.

@Comandeer
Copy link
Member

Comandeer commented Feb 8, 2018

I've updated issue's title and description.

@Comandeer Comandeer changed the title Bug in CKEDITOR.plugins.link.getSelectedLink Double-click on link opens empty link dialog due to bug in getSelectedLink Feb 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression This issue is a regression. status:confirmed An issue confirmed by the development team. target:minor Any docs related issue that can be merged into a master or major branch. type:bug A bug.
Projects
None yet
Development

No branches or pull requests

5 participants