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

Select image with keyboard #2951

Merged
merged 2 commits into from
Feb 18, 2025
Merged

Conversation

juliaroldi
Copy link
Contributor

If there were no image selected, and the selection changed to a single image, select the image as image selection.

ImageKeyboardSelection

selection.focusOffset != range.endOffset,
});
} else if (newSelection?.type !== 'image' && image) {
this.editor.setDOMSelection({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question, if I select text+image, will it also trigger the event?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should not trigger, the isSingleImageInSelection function verifies if there is only an image in the range selection. So, the image will be selected only if there only one image and no text or other element.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. Sounds good.

@juliaroldi juliaroldi merged commit 9b93cf4 into master Feb 18, 2025
7 checks passed
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

Successfully merging this pull request may close these issues.

3 participants