Skip to content

🐛 - Fix 1655- Dynamic form should not display any validation errors until the user clicks Save/Submit, or leaves the focus of a required control - (Repo Rescuer Challenge) #1963

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

Merged
merged 2 commits into from
Mar 14, 2025

Conversation

NishkalankBezawada
Copy link
Contributor

Q A
Bug fix? [x]
New feature? [ ]
New sample? [ ]
Related issues? fixes #1655

What's in this Pull Request?

Fixing issue #1655

Observation

When loading a Dynamic Form with no list item id (new item), the form should not display any validation errors until the user clicks Save/Submit, or leaves the focus of a required control.

Actual behavior

When loading a Dynamic Form with no list item id (new item) all of the required fields display validation errors by default.

Solution

In DynamicField.tsx component, individual field is set and the validation is done through the methods getRequiredErrorText() and getNumberErrorText()

These methods currently are only checking with changedValue property, which will be always empty for a new item. An additional check is done on basis of listItemId assuming that the fact that for new item, this will be empty, we can achieve to not to show the validation errors on the form.

Screenshots

Observed

Issue1655

After change

Issue1615

Edit scenario

Issue1655-Edit

Thanks,
Nish

@NishkalankBezawada NishkalankBezawada changed the title Fix 1655- Dynamic form should not display any validation errors until the user clicks Save/Submit, or leaves the focus of a required control - (Repo Rescuer Challenge) 🐛 - Fix 1655- Dynamic form should not display any validation errors until the user clicks Save/Submit, or leaves the focus of a required control - (Repo Rescuer Challenge) Mar 11, 2025
@AJIXuMuK AJIXuMuK merged commit caa5408 into pnp:dev Mar 14, 2025
1 check passed
@AJIXuMuK
Copy link
Collaborator

Thank you @NishkalankBezawada for the change!

@AJIXuMuK AJIXuMuK added this to the 3.21.0 milestone Mar 14, 2025
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

Successfully merging this pull request may close these issues.

2 participants