UXP: Photoshop's color picker intermittently cancels the modal dialog that opened it

A modal dialog (dialog.uxpShowModal) opens the color picker via batchPlay showColorPicker. On dismissal the plugin’s dialog sometimes gets a cancel and closes with “reasonCanceled”. About 1 in 20 picks. All dismissal routes do it: OK button, ENTER in K:/B:/b:, and Escape

The cancel lands ~50 ms AFTER batchPlay resolves, with dialog.open still true in between, so it is not the picker’s modal loop unwinding. It cannot be refused: capture-phase listener, cancelable=true, preventDefault + stopImmediatePropagation, dialog.open=false on the next tick. With the mouse there is no key event at all (document-capture keydown/keyup/keypress log nothing), so it is not a leaked keystroke. Focus state makes no difference.

Attached: minimal repro plugin (4 files, no dependencies) and two annotated logs.

picker_cancel_repro.zip (5.6 KB)

1 Like