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

Linked inline image has no image toolbar when selected #9522

Closed
oleq opened this issue Apr 20, 2021 · 2 comments
Closed

Linked inline image has no image toolbar when selected #9522

oleq opened this issue Apr 20, 2021 · 2 comments
Assignees
Labels
domain:ui/ux This issue reports a problem related to UI or UX. package:image package:link squad:core Issue to be handled by the Core team. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@oleq
Copy link
Member

oleq commented Apr 20, 2021

📝 Provide detailed reproduction steps (if any)


If you'd like to see this fixed sooner, add a 👍 reaction to this post.

@oleq oleq added type:bug This issue reports a buggy (incorrect) behavior. package:image package:link domain:ui/ux This issue reports a problem related to UI or UX. squad:core Issue to be handled by the Core team. labels Apr 20, 2021
@oleq
Copy link
Member Author

oleq commented Apr 20, 2021

Looks like this helper got lost when resolving conflicts

getSelectedImageWidget( selection ) {
		const viewElement = selection.getSelectedElement();

		if ( viewElement ) {
			if ( this.isImageWidget( viewElement ) ) {
				return viewElement;
			}

			// If a selected inline image widget is the only child of a link, the selection will encompass
			// that link. But this still counts as a selected image widget. This is what it looks like:
			// [<a href="..."><span class="image-inline ck-widget ck-widget_selected"><img ... /></span></a>]
			if ( viewElement.is( 'element', 'a' ) && viewElement.childCount === 1 ) {
				const firstChild = viewElement.getChild( 0 );

				if ( firstChild.is( 'element' ) && this.isImageWidget( firstChild ) ) {
					return firstChild;
				}
			}
		}

and it was used here https://github.com/ckeditor/ckeditor5/blame/0cb8e4c8cb6ffaac3359831e79688f1e627b3fc4/packages/ckeditor5-image/src/imagetoolbar.js#L55

@oleq oleq self-assigned this Apr 20, 2021
oleq added a commit that referenced this issue Apr 20, 2021
@oleq
Copy link
Member Author

oleq commented Apr 20, 2021

Closed in 6089549.

@oleq oleq closed this as completed Apr 20, 2021
@oleq oleq added this to the iteration 43 milestone Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:ui/ux This issue reports a problem related to UI or UX. package:image package:link squad:core Issue to be handled by the Core team. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

No branches or pull requests

1 participant