ui icon indicating copy to clipboard operation
ui copied to clipboard

feat: add destructive border to FormControl

Open pedrovrima opened this issue 1 year ago • 8 comments

This adds a border-destructive to the FormControl component in case of input error. I think this should be the default behavior in case of form error.

pedrovrima avatar Jun 28 '23 01:06 pedrovrima

⚠️ No Changeset found

Latest commit: 6b36c1bb14ef7107a066a6f56a89e4950f5c56dc

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

changeset-bot[bot] avatar Jun 28 '23 01:06 changeset-bot[bot]

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

Name Status Preview Comments Updated (UTC)
ui 🔄 Building (Inspect) Jun 28, 2023 0:10am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
next-template ⬜️ Ignored (Inspect) Jun 28, 2023 0:10am

vercel[bot] avatar Jun 28 '23 01:06 vercel[bot]

@pedrovrima is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Jun 28 '23 01:06 vercel[bot]

Thanks for your work but I think this feature might be something that not everybody likes as default option. Maybe you can add an option to enable it?

And another thing, if you make any changes to a component make sure to apply them to both styles default and new-york and then build the registry using:

pnpm build:registry

dan5py avatar Jun 28 '23 08:06 dan5py

Thanks @dan5py ! I will work on it.

pedrovrima avatar Jun 28 '23 11:06 pedrovrima

Added a boolean props to FormControl 'enableErrorHighlight' that triggers the styling. Let me know if this was not how you thought of it.

pedrovrima avatar Jun 28 '23 11:06 pedrovrima

This is great. Thanks for adding this in!

Joroze avatar Apr 13 '24 22:04 Joroze

Thank you for this! However, it appears the merge was unsuccessful. Please note that using border-destructive alone is not sufficient. Be sure to also include focus-visible:border-destructive and focus-visible:ring-destructive.

Fingertips18 avatar Jun 28 '24 18:06 Fingertips18