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

Setting Required=true stops a form from being submitted #1798

Closed
amchconsult opened this issue Sep 14, 2024 · 4 comments · Fixed by #1823
Closed

Setting Required=true stops a form from being submitted #1798

amchconsult opened this issue Sep 14, 2024 · 4 comments · Fixed by #1823
Assignees
Milestone

Comments

@amchconsult
Copy link

Great library component.
I was just trying and I found a problem using multiple="true" required is not working.
It keeps saying This is Field is required.
Thank you

@mattelen
Copy link
Collaborator

Can you create a jsfiddle so we can easily replicate and fix?

@amchconsult
Copy link
Author

@mattpepin-funeraweb
Copy link

In fact, required breaks the behavior even if multiple="false". Validation does not pass.

@mattelen mattelen self-assigned this Dec 31, 2024
@mattelen
Copy link
Collaborator

mmm so this isn't a quick fix. It appears that the required field we've attached it to is for searching values in the component, rather than having a selected value checked. To fix would require a bit of a re-write of the feature.

I would think that for the input to be valid for "required", one or more values are selected. I don't think we want to provide a way to say "Must have 2 or more selected" etc, as that can be done with other validation libraries.

In the meantime, as a temp fix would be not to have required set as true, but I understand that does defeat the whole purpose of the feature

@mattelen mattelen changed the title Version 3.1.0 Required Setting Required=true stops a form from being submitted Dec 31, 2024
@mattelen mattelen added this to the 3.2 milestone Jan 6, 2025
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 a pull request may close this issue.

3 participants