-
Notifications
You must be signed in to change notification settings - Fork 734
fixed maxChips props when chips passed as prop #2680
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
Conversation
When adding the example in the ticket to the PlaygroundScreen I get a red screen:
|
fixed |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, forgot to send...
src/components/chipsInput/index.tsx
Outdated
if (maxChips && index < maxChips) { | ||
return renderChip({index, chip, isMarkedForRemoval}); | ||
} | ||
if (!maxChips) { | ||
return renderChip({index, chip, isMarkedForRemoval}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (maxChips && index < maxChips) { | |
return renderChip({index, chip, isMarkedForRemoval}); | |
} | |
if (!maxChips) { | |
return renderChip({index, chip, isMarkedForRemoval}); | |
} | |
if (!maxChips || (maxChips && index < maxChips)) { | |
return renderChip({index, chip, isMarkedForRemoval}); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And maxChips
is missing from the dependencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
When looking at it again I am pretty sure we can shorten the line even more:
if (!maxChips || index < maxChips) {
Description
ChipsInput -
maxChips
prop support when passing chips list as a prop.Changelog
ChipsInput -
maxChips
prop support when passing chips list as a prop.Additional info
#2166