Skip to content

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

Open
atuttle wants to merge 1 commit into
svecosystem:mainfrom
atuttle:fix/field-errors-empty-div
Open

When there are no field errors, <FieldErrors> should output nothing#223
atuttle wants to merge 1 commit into
svecosystem:mainfrom
atuttle:fix/field-errors-empty-div

Conversation

@atuttle

@atuttle atuttle commented Jul 18, 2025

Copy link
Copy Markdown
Contributor

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.
@changeset-bot

changeset-bot Bot commented Jul 18, 2025

Copy link
Copy Markdown

⚠️ 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

@github-actions

github-actions Bot commented Jul 18, 2025

Copy link
Copy Markdown
Contributor
built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

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

@atuttle

atuttle commented Jul 18, 2025

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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
Copy Markdown
Member

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

@atuttle

atuttle commented Jul 21, 2025

Copy link
Copy Markdown
Contributor Author

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