Skip to content

Commit

Permalink
fix(look&feel): select id and label optional (#773)
Browse files Browse the repository at this point in the history
Co-authored-by: Jonathan VACHERAT <[email protected]>
  • Loading branch information
fffan64 and Jonathan VACHERAT authored Jan 20, 2025
1 parent c950411 commit 3522526
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export const SelectStory: Story = {
className: "",
options,
label: "Label",
id: "nameid",
disabled: false,
required: false,
placeholder: "Placeholder",
Expand Down
8 changes: 4 additions & 4 deletions client/look-and-feel/react/src/Form/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ type Props = Omit<
ComponentPropsWithRef<ReactSelect>,
"placeholder" | "noOptionsMessage"
> & {
id: string;
label: string;
id?: string;
label?: string;
options: { label: string; value?: string | number | readonly string[] }[];
value: Option | null;
errorLabel?: string;
Expand Down Expand Up @@ -57,7 +57,7 @@ const Select = forwardRef<
inputId = id || inputId;

return (
<>
<div>
{label && (
<label htmlFor={inputId} className="af-form__select-label">
{label}
Expand Down Expand Up @@ -120,7 +120,7 @@ const Select = forwardRef<
ref={inputRef}
/>
{errorLabel && <InputError id={idError} message={errorLabel} />}
</>
</div>
);
},
);
Expand Down

0 comments on commit 3522526

Please sign in to comment.