- Home
- Forum
- Angular - EJ 2
- Issue when trying to show/hide DocumentEditor toolbar with enableToolbar property
Issue when trying to show/hide DocumentEditor toolbar with enableToolbar property
Currently having issues when trying to dynamically show/ hide the documentEditor toolbar.
ie:
Setting
this.documentEditorContainerComponent.enableToolbar = false;
and
this.documentEditorContainerComponent.enableToolbar = true;
Issue is replicated here, https://stackblitz.com/edit/angular-jh55mcwt?file=src%2Fapp.component.html using the toggle, I am unable to switch between enableToolbar false/ true.
Hi Jason,
We have successfully replicated the issue; however, the script error encountered on our end differs from what you reported. A screenshot of the error has been attached for your reference. At present, we are in the process of validating this issue and will provide you with further details by August 28, 2025.
Regards,
Mohammed Affan C
Thanks for the reply, have been investigating further and suspect that this issue occurs when the toolbarMode is set to ribbon.
When it's set to Toolbar mode, the enableToolbar = true/false seems to work.
FYI: have raised a bug here: enableToolbar API doesn't work when toolbar mode is set to Ribbon in Angular | Feedback Portal
Hi Jason,
Thank you for the update. We have provided an update in the feedback as well. As mentioned in our previous update, we are in the process of validating this issue and will provide you with further details by August 28, 2025.
Regards,
Mohammed Affan C
Hi Jason,
We need an additional timeline to validate this issue and will provide you with further details by September 3, 2025.
Regards,
Thamizhselvan.
We have confirmed the reported issue "Disabling the Toolbar throws script error" as a defect and logged a defect report. We will include the fix in our Third weekly release after 2025 Volume 3 Main release which is scheduled for September 23, 2025.
Mano M
Hi Jason,
Thank you for the update. As mentioned in our previous update, we will include the fix in our third weekly release after the 2025 Volume 3 main release, which is scheduled for September 23, 2025.
Regards,
Mohammed Affan C
Hi Jason,
Regards,
Mohammed Kaif S
Hey all,
Thanks for resolve the above issue, but are you also able to confirm/ replicate another issue?
When we are currently setting both
documentEditor.restrictEditing = false;
documentEditor.enableToolbar = false;
we are encountering issues possibly again with the scripts?
Hey all,
Thanks for resolve the above issue, but are you also able to confirm/ replicate another issue?
When we are currently setting both
documentEditor.restrictEditing = false;
documentEditor.enableToolbar = false;
we are encountering issues possibly again with the scripts?
Note the toolbarMode = 'Ribbon'
Thanks,
Jason
Hi Jason,
We are currently reviewing your query based on the information provided. We will get back to you with further updates shortly.
Regards,
Sujitha S
Hi Jason,
We reviewed your query and tried to reproduce the script error, but we didn’t see any issue from our side. We tested by setting restrictEditing and enableToolbar to false by default and also checked while switching the toolbar mode and found there is no script error. We’ve attached a video for your reference and shared a StackBlitz sample.
To help us reproduce the issue on our side, could you please share the following details:
- Steps you followed and actions performed
- Screenshot of the issue you're facing
- If possible, please try to reproduce the issue in the StackBlitz sample we shared
This will help us understand and replicate the issue more effectively.
Sample: Qifwnnuh (duplicated) - StackBlitz
Regards,
Sujitha S
Attachment: Toggle_Toolbar_83505f1c.zip
Hey Siva,
Thanks for getting back to me!
Sorry I made a mistake to the Boolean assignments in my original comment. Essentially what we would like to achieve is to implement an edit and view mode.
where in edit mode:
enableToolbar = true;
restrictEditing = false;
and in view mode:
enableToolbar = false;
restrictEditing = true;
so the issue we are facing is that the switching between these 2 modes are not consistent, (they don't automatically update the documentEditor).
Additionally we have a feature where when we cancel editing, it would load the file again to simulate reverting the changes before the edits.
Stackblitz link with the scenario above:
https://stackblitz.com/edit/angular-jh55mcwt-hhmxbzff?file=src%2Fapp.component.ts
some console logs th:
Hi Jason,
Sorry for the delay, We have reproduced the reported issue and are currently in the process of validating it. We will provide you with further updates by October 07, 2025.
Regards,
Sujitha S
Hi
Jason,
We have confirmed the reported issue "When switching the toolbar from
enabled to disabled in Ribbon mode, a script error occurs" as a defect and logged
a defect report. We
will include the fix in our patch release, which is expected to be
released on October 28, 2025.
You can track the status
of the bug through the feedback link below:
Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.
Regards,
Vincent Kumar L
Hey all,
great to hear, thanks!
Hi Jason,
Thank you for your update.
As mentioned earlier, we will include the fix in our upcoming patch release, which is scheduled for October 28, 2025.
Regards,
Sujitha S
Hi Jason,
We
apologize for the inconvenience. We are unable to include the fix in this
release. We will include the fix in our upcoming patch release on November 04, 2025. If
we complete the work earlier, we will share a custom patch. We appreciate your
patience until then.
Regards,
Vincent Kumar L
Hi All,
We are glad to
announce that our patch release (v31.2.5) has been rolled out successfully. In
this release, we have added the fix for the reported issue 'When switching the toolbar from enabled to
disabled in Ribbon mode, a script error occurs'.
Please upgrade to
the latest version packages to resolve this issue:
NPM link:
https://www.npmjs.com/package/@syncfusion/ej2-documenteditor
https://www.npmjs.com/package/@syncfusion/ej2-react-documenteditor
https://www.npmjs.com/package/@syncfusion/ej2-angular-documenteditor
NuGet links:
https://www.nuget.org/packages/Syncfusion.Ej2.Wordeditor.ASPNet.Core/
https://www.nuget.org/packages/Syncfusion.Ej2.Wordeditor.ASPNet.MVC5/
Feedback Link: https://www.syncfusion.com/feedback/70501/when-switching-the-toolbar-from-enabled-to-disabled-in-ribbon-mode-a-script-error
Root Cause:
When switching from enabling to disabling the toolbar, in the viewer.ts file within the getLineWidgetInternal method, bodyWidgets is coming up as undefined. As a result, a script error occurs due to bodyWidgets being undefined.
Regards,
Vincent Kumar L
- 19 Replies
- 7 Participants
-
JA Jason
- Aug 22, 2025 06:53 AM UTC
- Nov 4, 2025 02:15 PM UTC