diff --git a/editor/src/components/inspector/sections/layout-section/flex-container-subsection/flex-container-controls.tsx b/editor/src/components/inspector/sections/layout-section/flex-container-subsection/flex-container-controls.tsx
index 5e0a813e1b2e..c8d79179ea14 100644
--- a/editor/src/components/inspector/sections/layout-section/flex-container-subsection/flex-container-controls.tsx
+++ b/editor/src/components/inspector/sections/layout-section/flex-container-subsection/flex-container-controls.tsx
@@ -16,9 +16,17 @@ import type { OptionsType } from 'react-select'
import { unsetPropertyMenuItem } from '../../../common/context-menu-items'
import { UIGridRow } from '../../../widgets/ui-grid-row'
import { PropertyLabel } from '../../../widgets/property-label'
-import { PopupList, useWrappedEmptyOrUnknownOnSubmitValue, NumberInput } from '../../../../../uuiui'
+import {
+ PopupList,
+ useWrappedEmptyOrUnknownOnSubmitValue,
+ NumberInput,
+ Icons,
+} from '../../../../../uuiui'
import { useContextSelector } from 'use-context-selector'
import type { FlexDirection } from '../../../common/css-utils'
+import { when } from '../../../../../utils/react-conditionals'
+import { Substores, useEditorState } from '../../../../editor/store/store-hook'
+import { flexDirectionSelector } from '../../../inpector-selectors'
type uglyLabel =
| 'left'
@@ -169,6 +177,11 @@ export const FlexWrapControl = React.memo((props: FlexWrapControlProps) => {
},
[onSubmit],
)
+ const flexDirection = useEditorState(
+ Substores.metadata,
+ flexDirectionSelector,
+ 'FlexWrapControl flexDirection',
+ )
return (
{
width: undefined,
}}
>
- option.value === props.value)}
- options={FlexWrapOptions}
- onSubmitValue={onSubmitValue}
- controlStyles={props.controlStyles}
- style={{ background: 'transparent' }}
- />
+
+ {when(flexDirection.startsWith('row'), )}
+ {when(flexDirection.startsWith('column'), )}
+ option.value === props.value)}
+ options={FlexWrapOptions}
+ onSubmitValue={onSubmitValue}
+ controlStyles={props.controlStyles}
+ style={{ background: 'transparent' }}
+ />
+
)
})
@@ -241,17 +258,17 @@ export const FlexGapControl = React.memo(() => {
onUnsetValues,
)
- const targetPath = useContextSelector(InspectorPropsContext, (contextData) => {
- return contextData.targetPath
- })
- const flexGapProp = React.useMemo(() => {
- return [stylePropPathMappingFn('gap', targetPath)]
- }, [targetPath])
+ const flexDirection = useEditorState(
+ Substores.metadata,
+ flexDirectionSelector,
+ 'FlexGapControl flexDirection',
+ )
return (