Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] checkValidity fails to validate Datagrid when deleting any row except the last one #5999

Open
celu opened this issue Feb 5, 2025 · 0 comments

Comments

@celu
Copy link

celu commented Feb 5, 2025

Describe the bug
If checkValidity function is called after deleting middle rows in Data grid component with required fields, the last row is not marked as required and displayed as red.

Version/Branch
Formiojs v5.0.1

To Reproduce
Steps to reproduce the behavior:

  1. Create form with dataGrid, adding a required text field.
  2. Render the form, with a button that calls the function checkValidity (https://help.form.io/developers/form-development/form-renderer#form.checkvalidity-data-dirty-row-silent)
  3. Use the form and add multiple rows, all without data filled.
  4. Call checkValidity(null, true, null, false) is called all rows are marked as error in red
  5. Delete a middle row (not last one).
  6. Recall the function checkValidity(null, true, null, false) and the last row is not marked as red (required) causing a bug.

Expected behavior
All rows should be marked as required and red when checkvalidity function is called despite removing a middle row, last row should be marked as an error one.

Screenshots
alt text

Additional context
The bug is also present in other legacy versions https://formio.github.io/formio.js/app/builder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant