Skip to content

Commit

Permalink
[Index Management] Fix Flashing error banner in Index Template form (e…
Browse files Browse the repository at this point in the history
…lastic#196786)

## Summary

Fixes elastic#194751 

In `EuiForm`, if the value of `isInvalid` is true, it will render
addressFormErrors tip messages.

And In `step_logistics.tsx`, `isInValid` is setted by
`isInvalid={isSubmitted && !isFormValid}`

But form `submit` method set `isSubmitted` to true first, then validate
form. At this time, `isSubmitted is true` and `isFormValid is
unedfined`. So addressFormErrors shows immediately.


![image](https://github.com/user-attachments/assets/687a359d-ed33-4860-8d96-4543f2ef4898)

**So, maybe when `isSubmitting` is true, addressFormErrors should not be
shown.**

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
viajes7 and elasticmachine authored Oct 22, 2024
1 parent 8e1fcc1 commit f629d96
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ export const StepLogistics: React.FunctionComponent<Props> = React.memo(
const {
submit,
isSubmitted,
isSubmitting,
isValid: isFormValid,
getErrors: getFormErrors,
getFormData,
Expand Down Expand Up @@ -275,7 +276,7 @@ export const StepLogistics: React.FunctionComponent<Props> = React.memo(

<Form
form={form}
isInvalid={isSubmitted && !isFormValid}
isInvalid={isSubmitted && !isSubmitting && !isFormValid}
error={getFormErrors()}
data-test-subj="stepLogistics"
>
Expand Down

0 comments on commit f629d96

Please sign in to comment.