question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Iframe and Quill-React, events are lost

See original GitHub issue

Hey,

I have an issue where I want to use React Quill within an iframe. It does render and callback events are triggered accordingly whenever typing in the editor, but the tool bar is not working at all.

This is what I do I am building a small template editor that will have areas (normal divs) that my hope is to convert into editable areas using Quill.

I then include my template into the iframe, but through ReactHtmlParser. With ReactHtmlParser I loop through each node and I look for divs (at the moment only one) with the cms-text data attribute.

ReactHtmlParser provides us with a transformer method. I am using that to convert <div data-cms-text="true"></div> to a Quill component:

<Quill
	onChange={contentUpdated}
	placeholder="Type something... :-)"
	theme={"snow"}
	key="some-uniqiue-key" />

This works!

screen shot 2019-02-12 at 13 12 51

This is what’s going wrong The Quill tool bar doesn’t respond to anything I do. It’s as those events are never registered within the iframe. I have set up a repo here that illustrates the problem: https://github.com/entiendoNull/react-iframe-test

To begin with I figured that this may have been a problem related to the usage react-frame-component and I filed this issue there: https://github.com/ryanseddon/react-frame-component/issues/133

It was then suggested that this is more of a problem related to QuillJS pointing out these two similiar issues: https://github.com/quilljs/quill/issues/1042#issue-182512608, https://github.com/quilljs/quill/issues/1386#issue-218121065

I am using this

“react”: “^16.8.1”, “react-dom”: “^16.8.1”, “react-frame-component”: “^4.0.2”, “react-html-parser”: “^2.0.2”, “react-quill”: “^1.3.3”,

This may be a problem that is directly related to just QuillJS, but I thought I’d try my luck here first. Do anyone have an idea how this can be achieved? Or of an alternative solution?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
entiendoNullcommented, Mar 20, 2019

Hey, well… My solution was unfortunately to skip React-Quill and move on to Slate. I did get that to work without issues.

In my original post I recently received this suggestion however: https://github.com/ryanseddon/react-frame-component/issues/133#issuecomment-471925298

Have a look 😃

0reactions
Sawan1994commented, Jun 4, 2020

@entiendoNull The github page on slate says that it’s in beta mode and there can be breaking changes. won’t that be a problem?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Iframe and Quill-React, events are lost #133 - GitHub
The Quill tool bar doesn't respond to anything I do. It's as those events are never registered within the iframe. What am I...
Read more >
Bountysource
Iframe and Quill -React, events are lost.
Read more >
react-quill - npm
During events, ReactQuill will make a restricted subset of the Quill API available as the editor argument. This prevents access to destructive ...
Read more >
Quill link handler not working - Stack Overflow
The toolbar handler just calls your given function when the button in the toolbar is clicked. The value passed in depends on the...
Read more >
API - Quill Rich Text Editor
Events. text-change; selection-change; editor-change; off; on; once ... Note even when Quill is empty, there is still a blank line in the editor, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found