Issue with Dynamic CSS Linear Gradient in Photoshop UXP (Windows)

,

I’m experiencing a problem with dynamic CSS linear gradients in the Photoshop UXP plugin on Windows. The gradient only updates visually when I either unhover the plugin area or click after making a change—it doesn’t reflect updates in real time as expected.
Interestingly, the same implementation works flawlessly in InDesign UXP, where the gradient updates immediately without requiring any interaction.

Photoshop Demo:

InDesign Demo:

Do you have any solution/hack for that?

1 Like

Did you try this? Window: requestAnimationFrame() method - Web APIs | MDN

I never tried this in UXP and I thought it is not even implemented in UXP but apparently it is there.

The requestAnimationFrame function doesn’t seem to solve that problem.
Temporary solution:

Of course, it is causing flashing.

I reported CSS gradients as failing to update properly in Photoshop years ago. Has never been fixed as far as I know (I try to test occasionally, but avoid it because the buggy condition looks terrible / confusing).

4 Likes

The scrollTo function solves the problem.

        const element = document.querySelector('.color-panel')
        if (element) {
            element.scrollTo(0, element.scrollTop)
        }
2 Likes