Allow copying from whole row

Summary:
Increase the mouse target for copying values from the the tree in a data inspector to the full row, not just the text.

Not sure if bringing reversing the order here has any unintended side-effects, but in testing it seems to work fine.

Reviewed By: mweststrate

Differential Revision: D28185064

fbshipit-source-id: b9b86a7e181bfd0083f2a3bcb24c571b5ec4647e
This commit is contained in:
Pascal Hartig
2021-05-04 10:34:36 -07:00
committed by Facebook GitHub Bot
parent d02951e8e9
commit bf571065f9

View File

@@ -43,6 +43,7 @@ const BaseContainer = styled.div<{depth?: number; disabled?: boolean}>(
margin: props.depth === 0 ? '7.5px 0' : '0',
paddingLeft: 10,
userSelect: 'text',
width: '100%',
}),
);
BaseContainer.displayName = 'DataInspector:BaseContainer';
@@ -606,19 +607,19 @@ export const DataInspectorNode: React.FC<DataInspectorProps> = memo(
}
return (
<BaseContainer
depth={depth}
disabled={!!setValueProp && !!setValue === false}>
<Dropdown overlay={getContextMenu} trigger={contextMenuTrigger}>
<Dropdown overlay={getContextMenu} trigger={contextMenuTrigger}>
<BaseContainer
depth={depth}
disabled={!!setValueProp && !!setValue === false}>
<PropertyContainer onClick={isExpandable ? handleClick : undefined}>
{expandedPaths && <ExpandControl>{expandGlyph}</ExpandControl>}
{descriptionOrPreview}
{wrapperStart}
</PropertyContainer>
</Dropdown>
{propertyNodesContainer}
{wrapperEnd}
</BaseContainer>
{propertyNodesContainer}
{wrapperEnd}
</BaseContainer>
</Dropdown>
);
},
dataInspectorPropsAreEqual,