#Select v7 - Clearable or searchable props not passed to classNames in createTheme

7 messages · Page 1 of 1 (latest)

sand crest
#

I am using createTheme to custimize for my needs. i want to pass clearable prop to component and get that prop in createTheme. like this
<Select
clearable
label="Your favorite library"
placeholder="Pick value"
data={[
{
label: "One",
value: "0"
},
{
label: "Two",
value: "1"
},
{
label: "Three",
value: "2"
}
]}
value={value}
onChange={(value) => setValue(value)}
/>

and access to clearable prop inside createTheme like this

export const mantineTheme = createTheme({
components: {
Select: Select.extend({
classNames: (theme, props) => ({
section: cn(
"data-[position=right]-pointer-events-none",
props.value && props.clearable && "data-[position=right]:pointer-events-auto",
),
})
})
}
})

#

@sonic sun is this a bug or it is not supported?

sonic sun
sand crest
#

@sonic sun Clearable is always undefined in this case. Even if i added it to the components

sonic sun
sand crest
#

Thanks!

sand crest
#

@sonic sun do you want me to report this issue too?