Modal state during user actions?

I am trying to run some actions while user interacts with the panel (dragging handles on the slider).
It was working fine in CEP, but in UXP I get an error that Photoshop is in the modal state . Are all user interactions considered to be modal state now?

Can you share a snippet of code that replicates this? I’ve not seen this in my experience, but I’ve only played with a couple of adjustments from sliders.

I was getting that error too when the user clicked the panel during batchplay operations. Turns out it was because all my batchplay snippets had the line “modalBehavior”: “fail” (seen in the example below).

By changing the word “fail” to “wait” or “execute”, the error stopped.


    // Selects all pixels on canvas
    const result = await require("photoshop").action.batchPlay(
    [
       {
          "_obj": "set",
          "_target": [
             {
                "_ref": "channel",
                "_property": "selection"
             }
          ],
          "to": {
             "_enum": "ordinal",
             "_value": "allEnum"
          },
          "_isCommand": true
       }
    ],{
       "synchronousExecution": false,
       "modalBehavior": "fail"
    });

I can try to come up with some simple example, but looks like it’s indeed some kind of modal state for while user interacts with panels.
Having while left mouse button is in on state it kicks in and, for example, level adjustment layer do not apply until the state goes to off with user releasing the mouse button.
Even setting modalBehavior to “execute” doesn’t help in this case