You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a custom toolbar item which I am using to launch a modal where the user may select some property from a list, some related text to the property is then intended to be inserted into the editor at the last cursor location. However, what is happening instead is that an infinite loop occurs, maybe related to onblur since i see the onblur callback being called continuously. I verified that if I just use a button outside the editor to insert some test text at the last cursor location this works, so issue is potentially related to the fact a popup dialog is present? I've spent hours trying to figure out what's going on and seems like it is likely a bug and not something I am doing incorrectly, though I'd be happy if the latter was the case.
Jodit Version: 3.16.6
Browser: Chrome OS: Mac Is React App: True
Code
// editor ref passed to Jodit like example, the Jodit ref is used to store actual editor instanceconsteditorRef=useRef(null)constjodit=useRef(null);// custom launcher added to config in toolbar, displays a modal window where user can select something, this modal has a callback onPropertySelect()constpropertySelectLauncher={iconURL: '/outline_add_black_24dp.png',exec: function(editor){// store the editor ref since the ref passed to Jodit is just for text area.jodit.current=editor;setDisplayPropertySelect(true);}}constonPropertySelected=(textToInsert)=>{// THIS IS WHERE INFINITE LOOP OCCURSjodit.current.selection.insertHTML("TESTING");}constonBlurCallback=(newContent)=>{console.log("on blur");setContent(newContent);}return(<Box><JoditEditorref={editorRef}value={content}// @ts-ignoreconfig={config}tabIndex={1}// tabIndex of textareaonBlur={onBlurCallback}// preferred to use only this option to update the content for performance reasonsonChange={contentParser}/>{isPropertySelectDisplayed&&<DialogForPropertySelectcallBack={onPropertySelected}.../>}<Box>
)
Expected behavior:
Jodit would insert the html at the last cursor location (since onblur should be saving the cursor)
Actual behavior:
Infinite loop occurs, onBlurCallback function is called continuously and app is frozen
The text was updated successfully, but these errors were encountered:
Issue:
I have a custom toolbar item which I am using to launch a modal where the user may select some property from a list, some related text to the property is then intended to be inserted into the editor at the last cursor location. However, what is happening instead is that an infinite loop occurs, maybe related to onblur since i see the onblur callback being called continuously. I verified that if I just use a button outside the editor to insert some test text at the last cursor location this works, so issue is potentially related to the fact a popup dialog is present? I've spent hours trying to figure out what's going on and seems like it is likely a bug and not something I am doing incorrectly, though I'd be happy if the latter was the case.
Jodit Version: 3.16.6
Browser: Chrome
OS: Mac
Is React App: True
Code
Expected behavior:
Jodit would insert the html at the last cursor location (since onblur should be saving the cursor)
Actual behavior:
Infinite loop occurs, onBlurCallback function is called continuously and app is frozen
The text was updated successfully, but these errors were encountered: