Skip to content

Commit 2cd2be3

Browse files
authored
#214 Fix root left padding when value is primitive (#215)
1 parent 94f275e commit 2cd2be3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ValueNodeWrapper.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,9 @@ export const ValueNodeWrapper: React.FC<ValueNodeProps> = (props) => {
344344
<div
345345
className="jer-component jer-value-component"
346346
style={{
347-
marginLeft: `${indent / 2}em`,
347+
// If parentData is null, then we have a Value node at the root level,
348+
// so don't indent it.
349+
marginLeft: parentData !== null ? `${indent / 2}em` : 0,
348350
position: 'relative',
349351
}}
350352
draggable={canDrag}

0 commit comments

Comments
 (0)