We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a2e451f commit ab46368Copy full SHA for ab46368
1 file changed
core/src/symbol/index.tsx
@@ -11,6 +11,13 @@ export const Quote = <T extends object>(
11
const { as, render, ...reset } = Comp;
12
const Elm = as || 'span';
13
const elmProps = { ...other, ...reset };
14
+ // Trim the leading and trailing spaces in children,
15
+ // and set it to undefined if it's an empty string or contains only spaces.
16
+ // https://github.com/uiwjs/react-json-view/issues/86
17
+ if (typeof elmProps.children === 'string') {
18
+ const trimmed = elmProps.children.trim();
19
+ elmProps.children = trimmed || undefined;
20
+ }
21
let result = { value, parentValue, keyName, keys: keys || (keyName ? [keyName] : []) };
22
const child = render && typeof render === 'function' && render(elmProps, result);
23
if (child) return child;
0 commit comments