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

Add prop to mark field as required #154

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mfrazie2
Copy link

@mfrazie2 mfrazie2 commented Oct 22, 2021

  • Add prop reference to README and interface
  • Add storybook entry
  • Add prop to mark field as required

Screen Shot 2021-10-22 at 1 47 33 PM

* Add prop reference to README and interface
* Add storybook entryAdd prop to mark field as required
@vercel
Copy link

vercel bot commented Oct 22, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/srigar/multiselect-react-dropdown/BDJFgwyeKF9GhQuW2aTiAnkpCq88
✅ Preview: https://multiselect-react-dropdown-git-fork-mfrazie2-mark-17d584-srigar.vercel.app

@mfrazie2
Copy link
Author

There is no feedback provided to the end user they are missing information. Open to suggestions on the best way to do so.

@mfrazie2
Copy link
Author

Leveraging the in browser alert for empty required fields
Screen Shot 2021-10-22 at 12 12 07 PM

@@ -527,6 +527,7 @@ export class Multiselect extends React.Component<IMultiselectProps, any> {
style={style['inputField']}
autoComplete="off"
disabled={singleSelect || disable}
required={required}
Copy link
Owner

Choose a reason for hiding this comment

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

Adding required in input doesn't help I believe, because input field will always be empty, after selecting any option we will clear the input field value. So it will always throw error.

Copy link
Author

Choose a reason for hiding this comment

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

🤦 Oh right. I jumped in without looking. I'll pull this back to a draft state and work on a different solution.

@mfrazie2 mfrazie2 marked this pull request as draft October 22, 2021 19:08
* Add validation message on field
@mfrazie2 mfrazie2 marked this pull request as ready for review October 25, 2021 15:36
@mfrazie2 mfrazie2 marked this pull request as draft December 31, 2021 19:41
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.

None yet

2 participants