Show/Hide document editor toolbar

import { useState } from 'react';
import { DocumentEditorContainerComponent, Toolbar } from '@syncfusion/ej2-react-documenteditor';
import { ButtonComponent } from '@syncfusion/ej2-react-buttons';

DocumentEditorContainerComponent.Inject(Toolbar);

export default function MyEditor(props) {

const [enabled, setEnabled] = useState(false);
let container: DocumentEditorContainerComponent;
return (<>
{ setEnabled(!enabled) }} >{enabled ? 'Hide' : 'Show'

ref={(scope) => { container = scope; }}
id="container"
style={{ height: "590px" }}
enableToolbar={enabled} />

);

}

Shows 2 toolbars on show.
Hide and show again then 3 and so and so on


Version: 20.4.38 & 20.4.48


1 Reply

DS Dhanush Sekar Syncfusion Team February 6, 2023 09:31 AM UTC

Hi Rob,


In version 20.4.48, we have tried to replicate the reported issue. We couldn't reproduce the issue on our end. We have prepared a sample for your reference.

Stackblitz link: https://stackblitz.com/edit/react-tafqcr?file=index.js

Could you please modify the above sample and send it back to us? So, we can reproduce the issue on our end. It will be helpful to validate this further and provide you with a solution as soon as possible.


Regards,

Dhanush Sekar


Loader.
Up arrow icon