From 2efd9e9c7af7505fc2400cf8c928a04273b33bf1 Mon Sep 17 00:00:00 2001 From: Andrew Prifer Date: Sun, 22 Jan 2023 17:54:43 +0100 Subject: [PATCH] Stop compound prop label being shifted when it's too long Fixed it by removing the fixed width. This is unnecessary since there's no value on the ribght to accommodate. --- theatre/core/src/propTypes/index.ts | 1 - .../DetailCompoundPropEditor.tsx | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/theatre/core/src/propTypes/index.ts b/theatre/core/src/propTypes/index.ts index b82e81b..2af27c8 100644 --- a/theatre/core/src/propTypes/index.ts +++ b/theatre/core/src/propTypes/index.ts @@ -734,7 +734,6 @@ const defaultNumberNudgeFn: NumberNudgeFn = ({ magnitude, }) => { const {range} = config - console.log(deltaX, deltaFraction, config) if ( !config.nudgeMultiplier && diff --git a/theatre/studio/src/panels/DetailPanel/DeterminePropEditorForDetail/DetailCompoundPropEditor.tsx b/theatre/studio/src/panels/DetailPanel/DeterminePropEditorForDetail/DetailCompoundPropEditor.tsx index 8e7ca48..325ddd1 100644 --- a/theatre/studio/src/panels/DetailPanel/DeterminePropEditorForDetail/DetailCompoundPropEditor.tsx +++ b/theatre/studio/src/panels/DetailPanel/DeterminePropEditorForDetail/DetailCompoundPropEditor.tsx @@ -50,7 +50,6 @@ const Padding = styled.div` padding-left: ${rowIndentationFormulaCSS}; display: flex; align-items: center; - width: calc(100% - var(--right-width)); ` const PropName = deriver(styled.div<{isHighlighted: PropHighlighted}>` @@ -179,13 +178,11 @@ function DetailCompoundPropEditor< if (!collapsedMap.has(globalPointerPath)) { collapsedMap.set(globalPointerPath, new Atom(isVectorProp(propConfig))) } - }, []) + }, [globalPointerPath, propConfig]) const box = collapsedMap.get(globalPointerPath) const isCollapsed = usePrism(() => { - const box = collapsedMap.get(globalPointerPath) - return box ? val(box.pointer) : isVectorProp(propConfig) }, [box])