gluestack

gluestack Logogluestack

Hide Placeholder on Select

nicholasjohn16 posted this in #support
Open in Discord
Avatar
nicholasjohn16OP
I have the following select. Is there a way so the "Select a priority" option isn't rendered? If I remove the property, the option is still visible, just blank.

<Select initialLabel="Normal" selectedValue={true}>
    <SelectTrigger>
        <SelectInput placeholder="Select a priority" />
        <SelectIcon>
            {/* <Icon /> */}
        </SelectIcon>
    </SelectTrigger>
    <SelectPortal>
    <SelectBackdrop />
    <SelectContent>
        <SelectDragIndicatorWrapper>
            <SelectDragIndicator />
        </SelectDragIndicatorWrapper>
        {PRIORITY.map(({name, value}) => (
            <SelectItem label={name} value={value} />
        ))}
    </SelectContent>
    </SelectPortal>
</Select>

2 Replies

Avatar
viraj1098
Sorry we have made mistake in our docs.
you can pass Default value and remove placeholder.
also you can control value by passing selectedValue="<value of your item>"