From 34895d38432a523d3abab1d24304a1e89e642851 Mon Sep 17 00:00:00 2001 From: chenos Date: Sat, 2 Jan 2021 09:23:02 +0800 Subject: [PATCH] fix: text field output up to 20 characters in the table --- packages/app/src/components/views/Field/index.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/app/src/components/views/Field/index.tsx b/packages/app/src/components/views/Field/index.tsx index 9e7e854e4..aee137b06 100644 --- a/packages/app/src/components/views/Field/index.tsx +++ b/packages/app/src/components/views/Field/index.tsx @@ -31,13 +31,20 @@ function getFieldComponent(type) { } export function StringField(props: any) { - const { value } = props; + const { value, viewType } = props; if (!value) { return null; } if (typeof value === 'object') { return JSON.stringify(value); } + if (viewType === 'table' && value.length > 20) { + return ( + { + e.stopPropagation(); + }} style={{maxWidth: 300}}>{value}}>{value.substring(0, 15)}... + ); + } return ( <>{value} );