ql-align html tag in custom toolbar throw error
See original GitHub issueI want to create a custom toolbar in HTML, but when I add ql-align tag, I got this error:
TypeError: Cannot read property 'innerHTML' of null
at IconPicker.selectItem (quill.js:9693)
at new IconPicker (quill.js:9684)
at quill.js:6739
at Array.map (<anonymous>)
at SnowTheme.buildPickers (quill.js:6734)
at SnowTheme.extendToolbar (quill.js:9851)
at SnowTheme.addModule (quill.js:6703)
at quill.js:6049
at Array.forEach (<anonymous>)
at SnowTheme.init (quill.js:6047)
Steps for Reproduction
code in html:
<select class="ql-align" />
Platforms: Chrome 68 on Mac 10.12.6
Version: “quill”: “^1.3.6”
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
quill error 'quill Invalid Quill container' - Stack Overflow
The problem was that Quill was initiated before the DOM container element was properly rendered. If you can make it sure (use a...
Read more >JS Error in text editor with custom toolbar item | Blazor Forums
The first editor is working well, but the last is throwing this js errors and i cant remove or edit the content well....
Read more >ngx-quill - npm
Using all is not recommended, it cause some unexpected sideeffects. Full Quill Toolbar HTML. Global Config. It is possible to set custom default ......
Read more >Controlled Example with Custom Toolbar (React 16.3.0)
In CodePen, whatever you write in the HTML editor is what goes within the <body> tags in a basic HTML5 template. So you...
Read more >Creating Reusable Custom Blazor Controls
Features Of The Blazor Quill Rich Text Editor Custom Control · Exports editor contents in Text, HTML, and Quill's native Delta format ·...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ran into this error when using react-quill (version 1.3.5, quill version 1.3.7).
In my case, it was occurring when rendering multiple quill editors each with their own custom toolbar.
Rendering
<App />
will fail with the errorUnhandled Rejection (TypeError): Cannot read property 'innerHTML' of null
Without the custom toolbar, the error is resolved:
To fix the issue in my case, the solution was to provide a unique className to the toolbar:
And in my real-world case, I elected to generate a unique className on the fly when the component mounts, this way I don’t have to supply one whenever I render the component.
NOTE: Ideally, quill would allow you to alternatively provide the actual HTML node as the container. That would remove the need for unique classNames or IDs. Maybe this is already possible? But it did not seem to work when I tried.
Facing the same issue. Would love to know how you “rendered again”. @Heyxuxiaoting