Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Nested Editor causes exception #1671

Closed
slava-osipov-qs opened this issue Feb 28, 2018 · 3 comments
Closed

Nested Editor causes exception #1671

slava-osipov-qs opened this issue Feb 28, 2018 · 3 comments

Comments

@slava-osipov-qs
Copy link

slava-osipov-qs commented Feb 28, 2018

Do you want to request a feature or report a bug?
I'm not sure. I think it is a bug, but fix might require new feature.

What is the current behavior?
In custom block renderer of outer Editor I add component that uses inner Editor in readOnly mode. Inner Editor is initialized with some content. When user click to the content of inner Editor then exception occur within getDraftEditorSelection of outer Editor. Draft can't found selected (in inner Editor) block in state of outer Editor.

If the current behavior is a bug, please provide the steps to reproduce...
Please ask for a sample, if description is not enough - I will prepare demo project.

What is the expected behavior?
No exception excepted.

Which versions of Draft.js, and which browser / OS are affected by this issue?
Draft 0.10.5. Running in Chrome 64.0.3282.186 (64bit) under Windows 10.

Did this work in previous versions of Draft.js?
I don't know.

Note
I guess author of #527 was right when mentioned global.getSelection. And my issue caused by context mess.

@TimSusa
Copy link

TimSusa commented Feb 28, 2018

Would you please provide us with a code sample, error message, etc.? As far as I know, a lot of Problems can occur, when using more than one editor instance or even nested as Plugin into an editor instance in one view. Is that your case here? I would claim, you should care about the focus.

@slava-osipov-qs
Copy link
Author

@niveditc
Copy link
Contributor

niveditc commented Sep 8, 2018

This issue isn't very actionable at the moment - we don't really provide much support for nested editors so you're kind of on your own to hack around any problems.

We're currently exploring a new data model backed by a tree structure (i.e. nested data) rather than a list of blocks & I believe that it may be able to eliminate many use cases that need multiple/nested editor instances. This feature is still alpha & experimental at the moment, and we don't have a clear timeline for when it will be stable.

@niveditc niveditc closed this as completed Sep 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants