Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Fix exception that occur after dragging the selection through the image #213

Merged
merged 3 commits into from
Dec 19, 2017

Conversation

ma2ciek
Copy link
Contributor

@ma2ciek ma2ciek commented Dec 12, 2017

Suggested merge commit message (convention)

Fix: Added fallback for Rect.getDomRangeRects() if the given range starts in text node. Closes ckeditor/ckeditor5#5416.

@ma2ciek ma2ciek requested review from oleq and szymonkups December 12, 2017 16:55
@ma2ciek ma2ciek changed the title Fix exception after dragging the selection through the image Fix exception that occur after dragging the selection through the image Dec 12, 2017
startContainerRect.width = 0;
let startContainer = range.startContainer;

if ( startContainer.nodeType === Node.TEXT_NODE ) {
Copy link
Member

Choose a reason for hiding this comment

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

Would be good to have an isText() util for that.

Copy link
Member

Choose a reason for hiding this comment

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

Actually, we have it in the DomConverter already :D And we use similar logic in scroll.js. So at least scroll.js and now rect.js should use it. DomConverter not necessarily.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can I make the above change as a follow-up?

Copy link
Member

Choose a reason for hiding this comment

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

👍

@oleq oleq merged commit bfa55e9 into master Dec 19, 2017
@oleq oleq deleted the t/ckeditor5-ui/317 branch December 19, 2017 14:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Edge/FF] Exception after dragging the selection through the image
4 participants