Skip to content

When there are no field errors, <FieldErrors> should output nothing #223

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

atuttle
Copy link
Contributor

@atuttle atuttle commented Jul 18, 2025

Previously, would output a div which could have a height and throw off the spacing of layouts/etc.

Previously, <FieldErrors> would output a div which could have a height
and throw off the spacing of layouts/etc.
Copy link

changeset-bot bot commented Jul 18, 2025

⚠️ No Changeset found

Latest commit: 7720cd5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Jul 18, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
formsnap ✅ Ready (View Log) Visit Preview 7720cd5

@atuttle
Copy link
Contributor Author

atuttle commented Jul 18, 2025

If you want me to add a changeset, let me know which semver level to bump. Since this changes output, some people would consider it a breaking change.

@huntabyte
Copy link
Member

This would be considered a breaking change. Having a div regardless of the error state makes it easy to keep spacing for errors even when they don't exist so that there isn't a ton of layout shift.

@huntabyte
Copy link
Member

And I think using the child snippet it should be possible today to avoid this default behavior right?

@atuttle
Copy link
Contributor Author

atuttle commented Jul 21, 2025

And I think using the child snippet it should be possible today to avoid this default behavior right?

Probably, yes, but that's a lot of extra markup to add to every field. Maybe an option to hide the div when there are no errors? Can default to false to preserve backwards compat.

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