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

Image resizer doesn't work with LinkImage #8749

Closed
Absolutely17 opened this issue Jan 5, 2021 · 1 comment · Fixed by #8809
Closed

Image resizer doesn't work with LinkImage #8749

Absolutely17 opened this issue Jan 5, 2021 · 1 comment · Fixed by #8809
Assignees
Labels
intro Good first ticket. package:image squad:core Issue to be handled by the Core team. type:bug This issue reports a buggy (incorrect) behavior. type:regression This issue reports a bug that was not present in the previous releases.

Comments

@Absolutely17
Copy link

📝 Provide detailed reproduction steps (if any)

  1. Insert image
  2. Add link to image using LinkImage plugin
  3. Close windows with editor and open again

✔️ Expected result

Resize buttons appeared on the image

❌ Actual result

Resize buttons did not appear on the image

This is due to a condition in imageresizehandler.js:

if ( !domEvent.target.matches( 'figure.image.ck-widget > img' ) ) { return; }
But with link on image the selector should be as follows: figure.image.ck-widget > a > img.

Tell me how can I fix this on my own? If I change imageresizehandler.js, then how can I load it correctly into my custom build

@Absolutely17 Absolutely17 added the type:bug This issue reports a buggy (incorrect) behavior. label Jan 5, 2021
@LukaszGudel
Copy link
Contributor

Hello. Thank you for the report. I can confirm this issue.


It can be reproduced by this data:

editor.setData(`<figure class="image"><a href="https://google.com"><img src="sample.jpg" alt="bar"></a></figure>`)

This behaviour is a regression. Git bisect points to this commit.

commit c5dd33d
Author: Paweł Smyrek <p.smyrek@cksource.com>
Date:   Fri Nov 20 08:48:28 2020 +0100
   Added stricter rule for attaching image resizer to an image
packages/ckeditor5-image/src/imageresize/imageresizehandles.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-) 

@LukaszGudel LukaszGudel added package:image squad:core Issue to be handled by the Core team. type:regression This issue reports a bug that was not present in the previous releases. labels Jan 5, 2021
@mlewand mlewand added the intro Good first ticket. label Jan 11, 2021
@mlewand mlewand added this to the nice-to-have milestone Jan 11, 2021
@oleq oleq modified the milestones: nice-to-have, backlog Jan 11, 2021
@oleq oleq modified the milestones: backlog, iteration 39 Jan 11, 2021
niegowski added a commit that referenced this issue Jan 12, 2021
Fix (image): Fixed image resizer for images with links. Closes #8749.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
intro Good first ticket. package:image squad:core Issue to be handled by the Core team. type:bug This issue reports a buggy (incorrect) behavior. type:regression This issue reports a bug that was not present in the previous releases.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants