diff --git a/editor/src/components/inspector/sections/component-section/component-section.tsx b/editor/src/components/inspector/sections/component-section/component-section.tsx index b374fe946e5f..2cc5c09bb48b 100644 --- a/editor/src/components/inspector/sections/component-section/component-section.tsx +++ b/editor/src/components/inspector/sections/component-section/component-section.tsx @@ -8,6 +8,7 @@ import type { ArrayControlDescription, BaseControlDescription, ControlDescription, + NoneControlDescription, ObjectControlDescription, RegularControlDescription, TupleControlDescription, @@ -934,6 +935,11 @@ const ArrayControlItem = React.memo((props: ArrayControlItemProps) => { const contextMenuItems = Utils.stripNulls([addOnUnsetValues([index], propMetadata.onUnsetValues)]) const contextMenuId = `context-menu-for-${PP.toString(propPathWithIndex)}` + + if (controlDescription.propertyControl.control === 'none') { + return null + } + return ( { ) const contextMenuItems = Utils.stripNulls([addOnUnsetValues([index], propMetadata.onUnsetValues)]) + const indexedPropertyControls = controlDescription.propertyControls[index] + + if (indexedPropertyControls.control === 'none') { + return null + } + return ( { key={index} > { open, mapToArray((innerControl: RegularControlDescription, prop: string, index: number) => { const innerPropPath = PP.appendPropertyPathElems(propPath, [prop]) + if (innerControl.control === 'none') { + return null + } return ( { RowForUnionControl.displayName = 'RowForUnionControl' interface RowForControlProps extends AbstractRowForControlProps { - controlDescription: RegularControlDescription + controlDescription: Exclude disableToggling?: boolean } diff --git a/editor/src/components/inspector/sections/component-section/folder-section.tsx b/editor/src/components/inspector/sections/component-section/folder-section.tsx index a69bc439e1cd..f360d0343489 100644 --- a/editor/src/components/inspector/sections/component-section/folder-section.tsx +++ b/editor/src/components/inspector/sections/component-section/folder-section.tsx @@ -88,6 +88,9 @@ export const FolderSection = React.memo((props: FolderSectionProps) => { const createRowForControl = (propName: string, focusOnMount: boolean) => { const controlDescription = props.propertyControls[propName] + if (controlDescription.control === 'none') { + return null + } return ( { propValue, propName, ) - return ( - - ) + if (controlDescription.control === 'none') { + return null + } else { + return ( + + ) + } } }), )} diff --git a/editor/src/components/inspector/sections/component-section/row-or-folder-wrapper.tsx b/editor/src/components/inspector/sections/component-section/row-or-folder-wrapper.tsx index 33fca0406c77..57c16b86ea69 100644 --- a/editor/src/components/inspector/sections/component-section/row-or-folder-wrapper.tsx +++ b/editor/src/components/inspector/sections/component-section/row-or-folder-wrapper.tsx @@ -19,6 +19,9 @@ type RowOrFolderWrapperProps = { } export const RowOrFolderWrapper = React.memo((props: RowOrFolderWrapperProps) => { + if (props.controlDescription.control === 'none') { + return null + } return (