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

Add/render to iframe #216

Merged
merged 4 commits into from
Aug 5, 2016

Conversation

vleletko
Copy link
Contributor

@vleletko vleletko commented Aug 3, 2016

As discussed in #215 , added support for Slate IFrame rendering, but in quite different way.

There is actually no need to pass dom={...} becasue valid window could be deducted by the event.native.target transparently.

One more problem found in React SelectionEventPlugin: it also has hardcoded window references.
Basicly version of SelectionEventPlugin swallowing all onSelection events, and this leads to incosistent slection state in slate.

To handle this I created small project react-frame-aware-selection-plugin

It is used in provided example.

@ianstormtaylor
Copy link
Owner

@vleletko very cool! I like how minimal the changes are.

Question for you: can you open a pull request on React with the injector functionality proposed? I'm a little wary of having to use the injector, and would love to see that logic added natively to React if they agree with it.

@ianstormtaylor
Copy link
Owner

Hey @vleletko also, I've just added the ability to "scroll to the cursor when a change is made" in 0.10.11, but I think this logic may also need to be reconsidered for iframes? Can you take a look and see what you think? Thanks!

@vleletko
Copy link
Contributor Author

vleletko commented Aug 4, 2016

@ianstormtaylor, checked code related to "scroll to the cursor when a change is made", and yes, to support iframes it should be changed.

Problem in element-scroll-to code.
It references to window and to document.body.
Opened issue #2

About custom injector - I'll open issue in react repo, but I think they will not change it, at least react-tap-event-plugin still exists.

btw, injector is used only in examples. We can remove Frame example from slate, and maybe make separate repo for it.

@ianstormtaylor ianstormtaylor merged commit 9cb361d into ianstormtaylor:master Aug 5, 2016
@ianstormtaylor
Copy link
Owner

Added in 0.11.2, thanks so much @vleletko for the help on this!

Updated the example to render with Bootstrap buttons and typography based on the rich text example. If you run into any issues while using it for your live preview let me know.

@vleletko
Copy link
Contributor Author

vleletko commented Aug 9, 2016

@ianstormtaylor, Thanks for great project!!

@vleletko vleletko deleted the add/render-to-iframe branch August 9, 2016 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants