mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-08 02:19:43 +00:00
Remove optional field from ha-form schema type (#11538)
This commit is contained in:
@@ -103,12 +103,13 @@ class StepFlowForm extends LitElement {
|
||||
const allRequiredInfoFilledIn =
|
||||
stepData === undefined
|
||||
? // If no data filled in, just check that any field is required
|
||||
this.step.data_schema.find((field) => !field.optional) === undefined
|
||||
this.step.data_schema.find((field) => field.required) === undefined
|
||||
: // If data is filled in, make sure all required fields are
|
||||
stepData &&
|
||||
this.step.data_schema.every(
|
||||
(field) =>
|
||||
field.optional || !["", undefined].includes(stepData![field.name])
|
||||
!field.required ||
|
||||
!["", undefined].includes(stepData![field.name])
|
||||
);
|
||||
|
||||
if (!allRequiredInfoFilledIn) {
|
||||
|
||||
Reference in New Issue
Block a user