From 2c98af77c3633e10ce38f4592718eb08096ceecf Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Tue, 10 Sep 2019 14:57:33 -0700 Subject: [PATCH] DevTools: Props editing interface tweaks (#16740) * Fix DevTools new prop input size * Don't allow adding new values unless an overridePropsFn function has been provided. * Do not show empty 'none' label ablve a new prop input --- .../src/devtools/views/Components/EditableValue.js | 4 +++- .../src/devtools/views/Components/InspectedElementTree.css | 4 ++++ .../src/devtools/views/Components/InspectedElementTree.js | 3 ++- .../src/devtools/views/Components/SelectedElement.js | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/react-devtools-shared/src/devtools/views/Components/EditableValue.js b/packages/react-devtools-shared/src/devtools/views/Components/EditableValue.js index 96f505c20f188..c196a8d83b74e 100644 --- a/packages/react-devtools-shared/src/devtools/views/Components/EditableValue.js +++ b/packages/react-devtools-shared/src/devtools/views/Components/EditableValue.js @@ -16,6 +16,7 @@ import {useEditableValue} from '../hooks'; type OverrideValueFn = (path: Array, value: any) => void; type EditableValueProps = {| + className?: string, dataType: string, initialValue: any, overrideValueFn: OverrideValueFn, @@ -23,6 +24,7 @@ type EditableValueProps = {| |}; export default function EditableValue({ + className = '', dataType, initialValue, overrideValueFn, @@ -74,7 +76,7 @@ export default function EditableValue({ )} - {isEmpty &&
None
} + {isEmpty && !canAddEntries &&
None
} {!isEmpty && (entries: any).map(([name, value]) => ( {type === ElementTypeSuspense ? (