Skip to content

Commit b8a3848

Browse files
committed
fix:- Error list on JSON Schema Form
1 parent dde6838 commit b8a3848

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy