Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,13 @@ export function usePlacementCoordinator(config: PlacementCoordinatorConfig): Rea

const onShelfMove = (event: ShelfEvent) => {
has3DPointerDrivenMoveRef.current = true
// Guard against null ref. The mitt event listener can fire after the
// component unmounts (or before the <group ref> attaches), and the
// unguarded `cursorGroupRef.current.rotation.y = ...` write below was
// the source of EDITOR-BC (`Cannot read properties of null (reading
// 'rotation')`) — 53k+ events. Every other surface-move handler in
// this file already has this guard; onShelfMove was missed in #323.
if (!cursorGroupRef.current) return
const ctx = getContext()
if (ctx.state.surface !== 'shelf-surface') {
// Cursor entered via a move event without an enter — try
Expand Down