Sp-button sp-action-button clicked on host focus change

Hi everyone

I’m having an issue when using sp-button and sp-action-button.
Tried both and got the same behavior.

When attaching a ‘click’ event listener the button is receiving a click event
after the host loses and gains focus again, if the button has focus.

In my case I’m opening a fs.getFolder() within the handler.
And what happens is that once a folder is chosen the host receives focus again
and the button that was just clicked also has focus and receives another click.

Also tried just with a simple console.log to show the event triggering.

Anyone with the same issue?

Thanks

Henrique \ TMMW
Text Replacer for Premiere Pro | Clips Exporter | Thumbs Up | Selector for Premiere Pro

In your onclick handler, be sure to blur the button so that it no longer has focus. That will prevent future clicks.

Which version of Ps are you on currently?

I’m in 22.5

Thanks for suggesting blur, I’ll add that.