You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using useOptimistic to update draggable array components, items are no longer set as draggable in the overlay.
This only occurs in a production build, in dev it works as expected.
Build and run start, observe items no longer draggable
Remove useOptimistic
Build and run start, observe draggable items, with no optimistic updates.
Expected behavior
Draggable items with client-side updates in production
Screen Recordings
Dev server (with useOptimistic): ✅
draggable-dev.mov
Prod server (with useOptimistic): ❌
draggable-prod.mov
Prod server (without useOptimistic): ✅
draggable-prod-non-optimistic.mov
Note: ignore the repeated fading to black related to #2087
Which versions of Sanity are you using?
@sanity/cli (global) 3.62.3 (up to date)
@sanity/assist 3.0.8 (up to date)
@sanity/icons 3.4.0 (up to date)
@sanity/image-url 1.1.0 (up to date)
@sanity/mutate 0.10.1 (up to date)
@sanity/presentation 1.17.7 (up to date)
@sanity/preview-url-secret 2.0.0 (up to date)
@sanity/util 3.62.3 (up to date)
@sanity/vision 3.62.3 (up to date)
@sanity/visual-editing 2.4.2 (up to date)
sanity 3.62.3 (up to date)
What operating system are you using?
OSX + Chrome
Which versions of Node.js / npm are you running?
v22.0.0
Additional context
When testing I found that the useOptimistic hook is somehow messing with useOptimisticActorReady in production since optimisticActorReady gets set to false when it's used:
When using
useOptimistic
to update draggable array components, items are no longer set as draggable in the overlay.This only occurs in a production build, in dev it works as expected.
To Reproduce
useOptimistic
Expected behavior
Draggable items with client-side updates in production
Screen Recordings
Dev server (with useOptimistic): ✅
draggable-dev.mov
Prod server (with useOptimistic): ❌
draggable-prod.mov
Prod server (without useOptimistic): ✅
draggable-prod-non-optimistic.mov
Note: ignore the repeated fading to black related to #2087
Which versions of Sanity are you using?
What operating system are you using?
OSX + Chrome
Which versions of Node.js / npm are you running?
v22.0.0
Additional context
When testing I found that the useOptimistic hook is somehow messing with
useOptimisticActorReady
in production sinceoptimisticActorReady
gets set to false when it's used:visual-editing/packages/visual-editing/src/ui/Overlays.tsx
Line 329 in f1d04b3
The text was updated successfully, but these errors were encountered: