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; 


Image_1497_1755845521802


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.


19 Replies

MA Mohammed Affan Saqib Hussain Syncfusion Team August 25, 2025 12:13 PM UTC

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



JA Jason August 25, 2025 11:50 PM UTC

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



MA Mohammed Affan Saqib Hussain Syncfusion Team August 26, 2025 08:17 AM UTC

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



TV Thamizhselvan Varadharajan Syncfusion Team September 1, 2025 08:23 AM UTC

Hi Jason,

We need an additional timeline to validate this issue and will provide you with further details by September 3, 2025.


Regards,
Thamizhselvan.



MM Mano Murugan Syncfusion Team September 3, 2025 04:10 PM UTC

Hi Jason,
    We have confirmed the reported issue "Disabling the Toolbar throws script erroras 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.

You can track the status of the bug through the feedback link below:
Disabling the Toolbar throws script error in Angular | Feedback Portal
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

Mano M



JA Jason replied to Mano Murugan September 3, 2025 11:41 PM UTC

Great, thanks!



MA Mohammed Affan Saqib Hussain Syncfusion Team September 4, 2025 05:27 AM UTC

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



MK Mohammed Kaif Shahul Hameed Syncfusion Team September 23, 2025 04:32 PM UTC

Hi Jason,

We are glad to announce that our patch release (v31.1.21) has been rolled out successfully. In this ‎release, we have added the fix for the reported issue 'Console exception when toolbar is disabled'.
Please upgrade to the latest version packages to resolve this issue:‎

NPM link:
NuGet link:‎

Regards,

Mohammed Kaif S



JA Jason September 29, 2025 02:17 AM UTC

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?



JA Jason September 29, 2025 02:19 AM UTC

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



SS Sujitha Siva Syncfusion Team October 1, 2025 04:19 AM UTC

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



SS Sujitha Siva Syncfusion Team October 1, 2025 10:20 AM UTC

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:

  1. Steps you followed and actions performed
  2. Screenshot of the issue you're facing
  3. 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


JA Jason October 2, 2025 01:38 AM UTC

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.

Image_3158_1759368935574


Stackblitz link with the scenario above:
https://stackblitz.com/edit/angular-jh55mcwt-hhmxbzff?file=src%2Fapp.component.ts

some console logs th:
Image_3750_1759369071255



SS Sujitha Siva Syncfusion Team October 6, 2025 04:31 PM UTC

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



VK Vincent Kumar Lourdu Josephraj Syncfusion Team October 7, 2025 04:11 PM UTC

Hi Jason,
 

    We have confirmed the reported issue "When switching the toolbar from enabled to disabled in Ribbon mode, a script error occursas 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:

https://www.syncfusion.com/feedback/70501/when-switching-the-toolbar-from-enabled-to-disabled-in-ribbon-mode-a-script-error
 

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



JA Jason October 7, 2025 10:55 PM UTC

Hey all, 

great to hear, thanks!



SS Sujitha Siva Syncfusion Team October 10, 2025 05:11 AM UTC

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



VK Vincent Kumar Lourdu Josephraj Syncfusion Team October 28, 2025 02:52 PM UTC

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



VK Vincent Kumar Lourdu Josephraj Syncfusion Team November 4, 2025 02:15 PM UTC

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


Loader.
Up arrow icon