Skip to content

Commit 95b5e9b

Browse files
Merge pull request #1703 from kamalqureshi/updated_json_schema_form
Fixed Error-list in JSON schema form
2 parents dde6838 + b8a3848 commit 95b5e9b

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

client/packages/lowcoder/src/comps/comps/jsonSchemaFormComp/jsonSchemaFormComp.tsx

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -163,30 +163,11 @@ function transformErrors(errors: RJSFValidationError[]): RJSFValidationError[] {
163163
if (message) {
164164
// Error message displayed below the comp (will not be displayed when "ui:help" is set in the UI schema)
165165
error.message = message;
166-
// Errors displayed in the error list, not displayed when empty
167-
error.stack = "";
168166
}
169167
return error;
170168
});
171169
}
172170

173-
function ErrorList(props: ErrorListProps) {
174-
const errors = props.errors.filter((error) => error.stack);
175-
// Avoid showing blank space when there are no errors
176-
if (errors.length === 0) {
177-
return <></>;
178-
}
179-
return (
180-
<div style={{ color: "red" }}>
181-
<ul>
182-
{errors.map((error) => (
183-
<li key={error.stack}>{error.stack}</li>
184-
))}
185-
</ul>
186-
</div>
187-
);
188-
}
189-
190171
const SearchableSelectWidget = (props : any) => {
191172
const { options, value, required, disabled, readonly, autofocus, onChange } = props;
192173
const { enumOptions } = options;
@@ -300,10 +281,9 @@ let FormBasicComp = (function () {
300281
templates={{
301282
ObjectFieldTemplate: ObjectFieldTemplate,
302283
ArrayFieldTemplate: ArrayFieldTemplate,
303-
// FieldTemplate: LayoutFieldTemplate,
304284
}}
285+
liveValidate={true}
305286
widgets={{ searchableSelect: SearchableSelectWidget }}
306-
// ErrorList={ErrorList}
307287
children={
308288
<Button
309289
hidden={buttonOptions?.norender}

0 commit comments

Comments
 (0)