Skip to content

Commit

Permalink
fix(events): sort by distance on undefined roots
Browse files Browse the repository at this point in the history
  • Loading branch information
Inuniku committed Oct 29, 2022
1 parent 51ec316 commit bc1f957
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/fiber/src/core/events.ts
Expand Up @@ -224,7 +224,7 @@ export function createEvents(store: UseBoundStore<RootState>) {
.sort((a, b) => {
const aState = getRootState(a.object)
const bState = getRootState(b.object)
if (!aState || !bState) return 0
if (!aState || !bState) return a.distance - b.distance
return bState.events.priority - aState.events.priority || a.distance - b.distance
})
// Filter out duplicates
Expand Down

0 comments on commit bc1f957

Please sign in to comment.