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
If you apply any sort of conditional rendering to the toolbarElement from the useMultiRootEditor hook, the toolbar will fail to display if it is not immediately mounted, or mounted later
e.g.
importReact,{useState}from"react";importMultiRootEditorfrom"@ckeditor/ckeditor5-build-multi-root";import{useMultiRootEditor}from"@ckeditor/ckeditor5-react";exportdefaultfunctionMultiRootEditorDemo(props){const[showToolbar,setShowToolbar]=useState(false);consteditorProps={editor: MultiRootEditor,data: props.data};const{ toolbarElement, editableElements }=useMultiRootEditor(editorProps);return(<><div><buttononClick={()=>setShowToolbar(!showToolbar)}>
Show Toolbar
</button></div><hr/><div><div>ShowToolbar is set to: {JSON.stringify(showToolbar)}</div><div>{showToolbar&&toolbarElement}</div>{editableElements}</div></>);}
In the above example, using the button to set showToolbar to true, still doesn't let the toolbar render.
If showToolbar is initially set to true then the toolbar is rendered, but if the button is clicked to flip showToolbar to false it is impossible to render the toolbar again.
If you apply any sort of conditional rendering to the
toolbarElement
from theuseMultiRootEditor
hook, the toolbar will fail to display if it is not immediately mounted, or mounted latere.g.
In the above example, using the button to set
showToolbar
totrue
, still doesn't let the toolbar render.If
showToolbar
is initially set totrue
then the toolbar is rendered, but if the button is clicked to flipshowToolbar
tofalse
it is impossible to render the toolbar again.https://codesandbox.io/p/sandbox/condescending-shape-ks59rp?file=%2Fsrc%2Findex.js
The text was updated successfully, but these errors were encountered: