Hello, all!
I’m working on a UXP plugin for Photoshop, not using React. I need to provide the user a means to select a folder from which the plugin will subsequently retrieve various preferences that will affect subsequent processing. It seems that the best practice (perhaps the only workable one?) is to use fs.getFolder().
My problem is that the picker dialog opened by fs.getFolder() does not execute as a modal dialog, thus allowing the user to continue interacting with the UI while the dialog is open. Not good! Ifd I were implementing my own dialog, this would be simple matter of using uxpShowModal().
I must be missing something really obvious, as I see lots of instances in other UXP plugins that I use where the implementation behaves exactly as I would wish.
The following snippet illustrates the issue:
document.getElementById("buttonOne").addEventListener("click", async () => {
buttonOneClicked();
});
document.getElementById("buttonTwo").addEventListener("click", async () => {
buttonTwoClicked();
});
async function buttonOneClicked() {
console.log("Button One clicked");
const selectedFolder = await fs.getFolder();
console.log("Button One selected folder: " + selectedFolder);
}
async function buttonTwoClicked() {
console.log("Button Two clicked");
const selectedFolder = await fs.getFolder();
console.log("Button Two selected folder: " + selectedFolder);
}
The user clicks Button One, the getFolder() picker dialog opens, then the user clicks Button Two, and yet another picker dialog opens. The console shows the two “Button XXX clicked” messages. Both dialogs are open.
Thanks