eufemia icon indicating copy to clipboard operation
eufemia copied to clipboard

Form.Section.EditContainer validation issues

Open andlbrei opened this issue 6 months ago • 0 comments

🐛 Bug Report

Form.Section.EditContainer validation does not always work.

I have come across two issues which is shown in this reproduction:

  • When the edit container is opened and the user attempts to finish without doing any changes, leaving the required fields blank, the user is allowed to do so. Attempting to go to the next page will trigger validation, and force the user to fill in the required fields.
  • Cancelling editing after having removed text in a required field is allowed by the container, and the blank field is stored. Again, trying to progress in the form will trigger a validation error. Going by this reproduction, this only happens on nested paths.

https://github.com/user-attachments/assets/1e7b05fb-9c41-4aa3-ae63-12c3e82bc936

To Reproduce

In this reproduction step 1 will demonstrate no validation on cancel and step 2 will have working cancel. In step 1 the containers are within a Form.Section with a set path, while in step 2 they are within a Form.Section with no path.

https://codesandbox.io/p/sandbox/nested-section-validation-issue-6mrxmv?file=%2Fsrc%2FApp.tsx%3A50%2C9

Expected behavior

I expect validation to be triggered when finishing changes, even if the user has made no changes. I expect cancelling to restore the data that was stored when the user opened the section for editing.

Eufemia Version

10.42.0

andlbrei avatar Aug 08 '24 06:08 andlbrei