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.

In the case of custom toolbars, modules->toolbar->handlers set the function will be error

See original GitHub issue

`import React from ‘react’; import ReactQuill, { Quill } from ‘react-quill’; import ‘./quill.snow.css’;

const Size = Quill.import(‘formats/size’); Size.whitelist = [‘14px’, ‘16px’, ‘18px’, ‘20px’, ‘24px’, ‘32px’, ‘40px’, ‘72px’]; Quill.register(Size, true);

const Editor = (props: { note: { context: string; }; setContent: any; }) => { return ( <div id={‘editor-container’}> <div id="toolbar-container"> <span className={‘ql-formats’}> <button className={‘ql-header’} value={1}/> <button className={‘ql-header’} value={2}/> </span> <span className={‘ql-formats’}> <select defaultValue={‘14px’} className=“ql-size”> <option value="14px">14px</option> <option value="16px">16px</option> <option value="18px">18px</option> <option value="20px">20px</option> <option value="24px">24px</option> <option value="32px">32px</option> <option value="40px">40px</option> <option value="72px">72px</option> </select> </span> <span className={‘ql-formats’}> <button className={‘ql-bold’}/> <button className={‘ql-italic’}/> <button className={‘ql-underline’}/> <button className={‘ql-align’} value={‘center’} /> <button className={‘ql-strike’}/> <button className={‘ql-blockquote’}/> <button className={‘ql-code-block’}/> </span> <span className={‘ql-formats’}> <select className="ql-color"> {/<option value={‘#ffffff’}></option>/} </select> <select className="ql-background"> {/<option value={‘#ffffff’}></option>/} </select> </span> <span className={‘ql-formats’}> <button className={‘ql-indent’} value={‘-1’} /> <button className={‘ql-indent’} value={‘+1’} /> </span> <span className={‘ql-formats’}> <button className={‘ql-link’} /> <button className={‘ql-image’}/> <button className={‘ql-video’} /> </span> <span className={‘ql-formats’}> <button className={‘ql-clean’} /> </span> </div> <ReactQuill style={{height: “calc(100vh - 230px)”}} value={props.note.context} onChange={props.setContent} modules={{ toolbar: { container: ‘#toolbar-container’, handlers: { ‘image’: () => { console.log(1) }, } }, }} placeholder={“记录你的生活…”} /> </div> ) };

export default Editor;`

After each entry, The cursor is lost and an error is declared ‘quill.js:3195 addRange(): The given range isn’t in document.’

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
leesamacommented, Jul 29, 2020

must use useCallback if you use module

0reactions
josevsalinacommented, Jun 17, 2020

My error was by the image handler, when I remove the handler work fine.

But in my case I need the color event handler and get the error

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use the custom toolbars and startup settings from earlier ...
Set Access to use only custom menu bars. Open your previous version Access database in the current version. Click the File tab, and...
Read more >
Toolbars - Menus and actions - Human Interface Guidelines
A toolbar provides convenient access to frequently used commands and controls that perform actions relevant to the current view.
Read more >
Toolbar Module - Quill Rich Text Editor
The Toolbar module allow users to easily format Quill's contents. It can be configured with a custom container and handlers.
Read more >
Process Streamlining: Catia Custom Toolbar - Optimal Device
In Catia V5 first select the workbench that you would like the toolbar to show up on. Then go to Tools>Customize then click...
Read more >
How to set menu to Toolbar in Android - java - Stack Overflow
just override onCreateOptionsMenu like this in your MainPage.java @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; ...
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