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

wip: add field validation #479

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft

wip: add field validation #479

wants to merge 12 commits into from

Conversation

chrisvxd
Copy link
Member

WIP implementation of field validation.

Usage

{
  type: "text",
  validate: (value) => {
    return { type: "error", message: "Something went wrong!" }
  }
}

This is non-trivial because it's not clear when to trigger a validation message.

Tasks

  • Figure out when the validation message should be shown, if at all
  • Abstract out validation from fields
  • Block publish if invalid data, and figure out how to show which data is invalid?

Closes #362

Copy link

vercel bot commented May 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
puck-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 12, 2024 7:49pm
puck-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 12, 2024 7:49pm

@IMythx
Copy link
Contributor

IMythx commented Jul 8, 2024

could use shadcn Form component and let the user provide his own zod validation or something and trigger the messages on publish...so the whole editor would be like a form and the publish button would trigger the form submition

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.

Field validation
2 participants