Disable a toolbar group instead hiding it

WebViewer Version: 8.12.0

In reviewing the documentation I encountered difficulty in locating a method to disable a toolbar group.

I attempted to utilize instance.UI.disableElements(['redactionToolGroupButton']);, but I observed that it hides the element from the DOM rather than making it disable. Is there a means to retain the button within the toolbar in a disabled state?

I have also tried instance.UI.disableTools

Thank you for posting your question to our forum. We will provide you with an update as soon as possible.

Hi there,

Thanks for reaching out to WebViewer forums,

In general if the tool is not being used it would be hidden from the UI as there would be no use-case for using it.
One option would be to disable it via JavaScript:
i.e.

    const iframeDoc = instance.UI.iframeWindow.document
    const dropdownButtons = iframeDoc.querySelectorAll('[data-element="dropdown-item-toolbarGroup-Redact"]')[0]
    dropdownButtons.disabled = true;

Another option would be to use the disableRedaction API: Apryse WebViewer Class: AnnotationManager

Best regards,
kevin Kim