Skip to content

Commit

Permalink
feat(c-select): add an id to allow form control
Browse files Browse the repository at this point in the history
  • Loading branch information
meretamal committed Apr 29, 2023
1 parent 7b372c0 commit 8230ff1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/c-select/c-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ export const CSelect = defineComponent({
disabled: {
type: Boolean,
},
id: {
type: String,
default: null,
},
},
emits: ['update:modelValue', 'input', 'change'],
setup(props, { emit, slots }) {
Expand All @@ -63,7 +67,7 @@ export const CSelect = defineComponent({
return () => (
<celeste.div class={`${baseClass.value}__container`}>
{props.label && (
<celeste.label class={`${baseClass.value}__label`}>
<celeste.label class={`${baseClass.value}__label`} for={props.id}>
{props.label}
</celeste.label>
)}
Expand All @@ -72,6 +76,7 @@ export const CSelect = defineComponent({
class={classes.value}
onInput={handleInput}
value={props.modelValue}
id={props.id}
>
{props.placeholder && (
<celeste.option value="" disabled>
Expand Down

0 comments on commit 8230ff1

Please sign in to comment.