When clicking View toolbar group ribbon, can I make it so that the selected default tool is the pan tool?

Which product are you using?
PDF.js Express Plus

PDF.js Express Version
8.7.4

Detailed description of issue
Let a user be in the Annotation toolbar group ribbon. If the user clicks on the View toolbar group ribbon, I want to make it so that the selected default tool will be the pan tool. Is this possible?

Expected behaviour
When clicking the Annotation toolbar group ribbon, the selected tool is the Pan tool.

Does your issue happen with every document, or just one?
N/A

Link to document
N/A

Code snippet
N/A

Hello hiraki,

You can do this with:

const pantool = instance.Core.documentViewer.getTool(instance.Core.Tools.ToolNames.PAN)
instance.Core.documentViewer.setToolMode(pantool)

Best regards,
Tyler

Hi tgordon,

Based on your code, I was able to fix it. Thank you for your help.

instance.UI.setToolMode(instance.Core.Tools.ToolNames.PAN)
instance.UI.addEventListener('toolbarGroupChanged', e => {
  if (e.detail === 'toolbarGroup-View') { 
     instance.UI.setToolMode(instance.Core.Tools.ToolNames.PAN)
      }
})

Kind regards,
hiraki