Hiding annotation popup after action button clicked

Good day :wave: I have a custom annotation popup menu buttons like so:

this.instance.UI.annotationPopup.update([
    {
        type: 'actionButton',
        title: 'Add Comment',
        img: '/img/icon-comment-text.svg',
        onClick: () => {
            console.log('Add Comment clicked')
        },
    },
])

So when I select annotation, the annotation popup is shown with my custom action buttons. It works flawlessly, except that after clicking the annotation popup menu stays on the screen (the annotation is selected). How do I hide annotation menu after the button is clicked? Deselecting annotations via deselectAllAnnotations doesn’t seem to help.

1 Like

Hi there,

Thanks for reaching out to WebViewer forums,

To close the popup, you can toggle it off via:

instance.UI.toggleElementVisibility('annotationPopup');

Best regards,
Kevin Kim

2 Likes

Thank you! It worked!

1 Like