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

ViewSelection instance is passed with viewMutations in mutations events, if possible. #626

Merged
merged 5 commits into from
Oct 17, 2016

Conversation

scofalik
Copy link
Contributor

@scofalik scofalik commented Oct 10, 2016

This implements some ideas and fixes some issues described in ckeditor/ckeditor5#3699.

This PR introduces viewSelection parameter to mutations event. viewSelection is instance of engine.view.Selection created basing on actual DOM selection. viewSelection is set only if DOM selection got correctly mapped to view. This means that it is available only when after mutations selection is placed in an already existing DOM node.

For now I feel this is enough. It solves an issue in Typing and right now we don't know whether anything else will use mutations.

Additionally, if DOM selection ends up in non-existing DOM node, we need to add a node in model anyway. This means that we should be able to handle setting model selection at that point.

@Reinmar
Copy link
Member

Reinmar commented Oct 17, 2016

screen shot 2016-10-17 at 14 01 42

@Reinmar
Copy link
Member

Reinmar commented Oct 17, 2016

Please correct the CC and and I'm merging this.

@Reinmar
Copy link
Member

Reinmar commented Oct 17, 2016

One more thing is missing – definition of the new param here: https://github.com/ckeditor/ckeditor5-engine/pull/626/files#diff-57e194ad013563b5752afa147f447d67R237

Copy link
Member

@Reinmar Reinmar left a comment

Choose a reason for hiding this comment

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

CC and new param's doc.

@Reinmar Reinmar merged commit 94746d5 into master Oct 17, 2016
@Reinmar Reinmar deleted the t/399 branch October 17, 2016 16:08
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.

2 participants