User is able to close a document while modal dialog is showing

The user is able to close a document by clicking the “x” button while a modal dialog is showing. Full disclosure: I am showing the dialog with dialog.uxpShowModal() because I like having the text in the title bar. ( PS 27.1.0 release, OSX Sonoma 14.4.1 )

Do you have that call inside an executeAsModal context?

Otherwise, try the (should be documented but probably isn’t yet) option:
{lockDocumentFocus: true}

3 Likes

I have also seen this ability to interact with PS while modal (clicking document tabs). Sometimes you have to click aggressively / repeatedly. Document switches are the cause of a large number of modal fails / race conditions I have seen over the year (less so these days as I have build a lot of defensive code).

That lockDocumentFocus sounds interesting. Is there a way to lock / unlock inside a modal if you want to add some protection but will also need to switch documents within that modal?

Which version was that added in, please?

Yes, the call is inside executeAsModal and yes lockDocumentFocus works! Thank you!

On a related note I feel like the user shouldn’t be able to pan the document with a trackpad either since the scrollbars are non responsive and zoom with trackpad is nonresponsive.

Speaking of documentation, I can’t find any adobe doc that mentions uxpShowModal() at all. Why is the current/future implementation showModal() with no options?

I would say that it should be usable all the way back to Ps 2022 (23.0). Apparently, it slipped through the cracks for documentation.