-
Notifications
You must be signed in to change notification settings - Fork 307
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
added possibility to set a max and min amount of items in the array f… #341
added possibility to set a max and min amount of items in the array f… #341
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@simon-virkesborsen is attempting to deploy a commit to the Measured Team on Vercel. A member of the Team first needs to authorize it. |
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.
Thanks for the contribution @jabba-the-bug, great stuff! Left one comment.
Can you also fix the formatting issues from the build? You can do that with yarn format
.
I'd also appreciate it if you added an example to the demo app - perhaps limit the buttons on the hero to min: 1
and max: 4
.
Finally, I'll need to add documentation to this. I'm happy to do it in a follow up PR.
packages/core/components/InputOrGroup/fields/ArrayField/index.tsx
Outdated
Show resolved
Hide resolved
Let me know if there is anything else needed. |
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.
Looks good! I'll make a few tweaks to docs after merge, but can you run yarn format
again? Your build is still failing.
disabled={ | ||
field.max !== undefined && | ||
localState.arrayState.items.length >= field.max | ||
} |
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.
Looks like we're missing disabled styles for this and the IconButton. I'll open a separate ticket for that.
Ran yarn format :) |
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.
🎉
Implemented what was described in this issue
#326
the code will disable delete/add buttons once the specified limit is reached
it will also swap the default icon for the alert-circle icon