I try to open a website from a model dialog, which works fine. However, whenever I get back to Photoshop, the website gets opened up again and the browser gets the focus back. I can only stop this by reloading the plugin. Any ideas what’s happening here?
Here’s the code ( tried the onlick version as well - without success) …
Didn’t notice any difference, apart from show() still letting interact with the app behind the dialog.
Now I’m thinking… What do you mean by this?
whenever I get back to Photoshop
How do you get back? Another button? Could it be by some accident you have two buttons with same ID and when you click this other “Close dialog” button it also triggers the link?
sp-link works. I will have to design the button for it though. The question is, why is sp-button acting so weird. I use the same technigue directly from the panel and there are no issues there.
“Getting back means” switching the focus back to Photoshop. In Windows by ALT-TAB or just by clicking on the tab at the bottom of the screen. It’s doesn’t matter which I use.
I use the inline version in a few places and it works. So that’s not the reason. It also works here - although not properly (as well as the external function handler).
<sp-action-button onClick='require("uxp").shell.openExternal("https://www.google.com")'>
Click me
</sp-action-button>
// or
<sp-button onClick='require("uxp").shell.openExternal("https://www.google.com")'>
Click me
</sp-button>
Just giving ideas at this point
Do you maybe have multiple dialogs with same button ID? Or maybe somewhere outside of the dialog? To me it sounds like there’s something with IDs and/or selectors
No. It’s the only one with that ID. And I just created a button in another dialog and the issue happens there as well. So it’s not specific to this individual dialog.
And as mentioned before - in the panel itself, the same button works fine.