Detect toggled notesPanel visibility

WebViewer Version: 8.7.0

“No” to all of these questions:

  • Do you have an issue with a specific file(s)?
  • Can you reproduce using one of our samples or online demos?
  • Are you using the WebViewer server?
  • Does the issue only happen on certain browsers?
  • Is your issue related to a front-end framework?
  • Is your issue related to annotations?

Is there a way to register an event listener that fires when the user opens/closes the notesPanel (right comment sidebar)?

Hi Nick,

thank you for contacting us regarding Webviewer.

You can try the event visibilityChanged.

The sample would be

  instance.UI.addEventListener('visibilityChanged', (event) => {
    console.log(event.detail);
  });

This should print out the {element: 'notesPanel', isVisible: false} when you close the notes panel, and it’s also applied to opening the notes panel.

Please let us know if this resolves your issue, thank you.