Skip to content

docs: illustrate how to check validity - #16186

Merged
teemingc merged 2 commits into
mainfrom
docs-issues-undefined
Jun 30, 2026
Merged

teemingc merged 2 commits into
mainfrom
docs-issues-undefined

Conversation

@Rich-Harris

Copy link
Copy Markdown
Member

alternative to #16137

@changeset-bot

changeset-bot Bot commented Jun 26, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f1dc53d

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

@svelte-docs-bot

Copy link
Copy Markdown

```

As with individual fields, `createPost.fields.allIssues()` will return `undefined` if the form as a whole is valid (or has not yet been validated).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding one more sentence (or note) saying negating allIssues() can be used to get the validity of the form. This echoes suggestion here by teemingc: #16080 (comment) and prevents people from looking for isValid() in the first place. What do you think?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I typically am not in favor of documenting how JavaScript works -- everyone who reads this should probably know that you can either negate this or compare it to undefined

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree with that sentiment

@teemingc teemingc added the documentation Improvements or additions to documentation label Jun 30, 2026
@teemingc teemingc linked an issue Jun 30, 2026 that may be closed by this pull request
@teemingc
teemingc merged commit f2fd815 into main Jun 30, 2026
6 checks passed
@teemingc
teemingc deleted the docs-issues-undefined branch June 30, 2026 13:13
Rich-Harris added a commit that referenced this pull request Jun 30, 2026
…ds.branch.leaf` has issues (#16187)

Companion to #16186 — right now we return an empty array when
`undefined` is more helpful. Small/edgey enough that I didn't think it
warranted a test

---

### Please don't delete this checklist! Before submitting the PR, please
make sure you do the following:
- [x] It's really useful if your PR references an issue where it is
discussed ahead of time. In many cases, features are absent for a
reason. For large changes, please create an RFC:
https://github.com/sveltejs/rfcs
- [x] This message body should clearly illustrate what problems it
solves.
- [ ] Ideally, include a test that fails without this PR but passes with
it.

### Tests
- [x] Run the tests with `pnpm test` and lint the project with `pnpm
lint` and `pnpm check`

### Changesets
- [x] If your PR makes a change that should be noted in one or more
packages' changelogs, generate a changeset by running `pnpm changeset`
and following the prompts. Changesets that add features should be
`minor` and those that fix bugs should be `patch`. Please prefix
changeset messages with `feat:`, `fix:`, or `chore:`.

### Edits

- [x] Please ensure that 'Allow edits from maintainers' is checked. PRs
without this option may be closed.

---------

Co-authored-by: Tee Ming <[email protected]>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose an isValid Field for Remote Form

4 participants