Skip to content

Pass the required prop to the combobox FieldLabel #690

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

Merged
merged 1 commit into from
Sep 16, 2022

Conversation

HichamELBSI
Copy link
Collaborator

Signed-off-by: HichamELBSI [email protected]

What does it do?

Allow the combobox to display the required state.

@vercel
Copy link

vercel bot commented Aug 30, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
design-system ✅ Ready (Inspect) Visit Preview Aug 30, 2022 at 3:57PM (UTC)
design-system-website ✅ Ready (Inspect) Visit Preview Aug 30, 2022 at 3:57PM (UTC)

@@ -250,7 +251,11 @@ export const Combobox = ({
{value}
</VisuallyHidden>
<Stack spacing={label || hint || error ? 1 : 0}>
{label && <FieldLabel id={labelId}>{label}</FieldLabel>}
{label && (
<FieldLabel required={required} id={labelId}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch! Could you also check if the labelAction is passed through as action={labelAction}? It seems to be missing too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nice catch! Pushed 👍🏽

Copy link
Contributor

@udimberto udimberto left a comment

Choose a reason for hiding this comment

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

LGTM

Observation

There's a strange behavior with the Combobox.
It's broking, when does not have any ComboboxOption as child.
But I think it's a problem to another time.

Good job

@HichamELBSI HichamELBSI force-pushed the enh/required-combobox branch from a75be4d to 42add10 Compare August 30, 2022 15:55
onClear,
placeholder,
required,
value,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ℹ️ Just sorting the props list 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

💡 We need an eslint rule for that.

Copy link
Contributor

@gu-stav gu-stav left a comment

Choose a reason for hiding this comment

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

Looks good to me. We should keep in mind that I think we need to create a ComboboxInput component to be consistent with the rest of the input fields at some point.

Well done - thanks!

@gu-stav gu-stav merged commit 084ba39 into main Sep 16, 2022
@gu-stav gu-stav deleted the enh/required-combobox branch September 16, 2022 13:48
@HichamELBSI HichamELBSI added the pr: fix This PR is fixing a bug label Sep 20, 2022
@HichamELBSI HichamELBSI added this to the 1.2.3 milestone Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: fix This PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants