diff --git a/editor/src/components/canvas/canvas-strategies/canvas-strategies.tsx b/editor/src/components/canvas/canvas-strategies/canvas-strategies.tsx index d8fcc710620a..1d4baaed6017 100644 --- a/editor/src/components/canvas/canvas-strategies/canvas-strategies.tsx +++ b/editor/src/components/canvas/canvas-strategies/canvas-strategies.tsx @@ -597,6 +597,17 @@ export function interactionInProgress(interactionSession: InteractionSession | n } } +function controlPriorityToNumber(prio: ControlWithProps['priority']): number { + switch (prio) { + case 'bottom': + return 0 + case undefined: + return 1 + case 'top': + return 2 + } +} + export function useGetApplicableStrategyControls(): Array> { const applicableStrategies = useGetApplicableStrategies() const currentStrategy = useDelayedCurrentStrategy() @@ -626,6 +637,11 @@ export function useGetApplicableStrategyControls(): Array controlPriorityToNumber(a.priority) - controlPriorityToNumber(b.priority), + ) + return applicableControls }, [applicableStrategies, currentStrategy, currentlyInProgress]) } diff --git a/editor/src/components/canvas/canvas-strategies/canvas-strategy-types.ts b/editor/src/components/canvas/canvas-strategies/canvas-strategy-types.ts index f1d3d30207e6..ed1f1938fa0b 100644 --- a/editor/src/components/canvas/canvas-strategies/canvas-strategy-types.ts +++ b/editor/src/components/canvas/canvas-strategies/canvas-strategy-types.ts @@ -98,6 +98,7 @@ export interface ControlWithProps

{ props: P key: string show: WhenToShowControl + priority?: 'top' | 'bottom' } export function controlWithProps

(value: ControlWithProps

): ControlWithProps

{