Is there a way to create an “OK” button in a UXP dialog modal that behaves like the OK button in Photoshop so that when you hit return, the autofocus is on the “OK” button, such that hitting return is like clicking the “OK” button. I can set the “OK” button to autofocus in HTML, but if the user interacts with the modal, like typing text in an input box, than the focus moves off the “OK” button and the action associated with the “OK” button doesn’t execute when the user hits return. In fact, after typing in an input box, hitting return is like hitting the ESC key, and the modal close without doing what the user expected after typing new information into the input box. This is the behavior on Windows. Haven’t tried this on Mac yet.
In Photoshop dialogs, like Image Size, hitting the return key resizes the image based on user’s new inputs in the dialog window. In other words, the focus is retained on the “OK” button even if the user interacts with other elements in the dialog window. It would be nice to emulate this behavior in UXP plugins also.