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

[@mantine/core] TagsInput: Fix required prop behavior #5032

Merged
merged 1 commit into from Oct 12, 2023

Conversation

sunadoi
Copy link
Contributor

@sunadoi sunadoi commented Oct 12, 2023

Fixes #5016

1. display asterisk when required prop is passed

Pass required prop to PillInput component so that an asterisk is displayed when required prop is passed to TagsInput.

2. fix form validation behavior when required prop is passed

The value prop of PillsInput.Field is _searchValue, which is empty immediately after splitting.
Therefore, setting required will enable form validation even if tag (_value) is present.

To fix this, the condition of required in PillsInput.Field is set to required && _value.length === 0.

@rtivital rtivital merged commit 29fef91 into mantinedev:master Oct 12, 2023
1 check passed
@rtivital
Copy link
Member

Thanks!

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.

TagsInput: required prop doesn't work as intended.
2 participants