gluestack-ui icon indicating copy to clipboard operation
gluestack-ui copied to clipboard

Select placeholder and value are not showing on android

Open sanaf1333 opened this issue 10 months ago • 2 comments

Description

I have created a component that is using Select. Everything seems to work fine on IOS but on android the placeholder and the value are not showing, i tried setting color explicitly but it is still not working. Can somebody please help me figure out what is wrong.

CodeSandbox/Snack link

https://codesandbox.io

Steps to reproduce

Here is my code <Select onValueChange={onChange} isDisabled={isDisabled} isInvalid={isInvalid} selectedValue={selectedLabel} defaultValue={selectedLabel} className="text-typography-500" > <SelectTrigger variant="rounded" size="md" className="absolute h-auto top-[14px] w-full text-sm py-3 border mb-[10px] justify-between px-[10px] text-typography-500" > <SelectInput placeholder={placeholderText} className="text-sm font-normal h-5 text-typography-500" selectionColor={"black"} placeholderTextColor={"#00000040"} style={{color: 'red', backgroundColor: 'yellow'}} /> <SelectIcon className="mr-3" as={ChevronDownIcon} color={disabled ? "#00000040" : "#000000E0"} /> </SelectTrigger> <SelectPortal> <SelectBackdrop /> <SelectContent className="max-h-[300px] pb-[50px] text-typography-500"> <SelectDragIndicatorWrapper> <SelectDragIndicator /> </SelectDragIndicatorWrapper> <ScrollView className="w-full"> {options.map((option) => ( <SelectItem label={option.label} value={option.value} key={option.value} className="text-typography-500" /> ))} </ScrollView> </SelectContent> </SelectPortal> </Select>

gluestack-ui Version

latest version

Platform

  • [x] Expo
  • [ ] React Native CLI
  • [ ] Next
  • [ ] Web
  • [x] Android
  • [ ] iOS

Other Platform

No response

Additional Information

No response

sanaf1333 avatar Jan 23 '25 08:01 sanaf1333

which expo version? we're unable to recreate the issue.

akash3gtm avatar Feb 20 '25 09:02 akash3gtm

I did encounter the same problem; on iOS everything is fine, on Android the values are not visible. I found out it is caused by SelectInput implicitly having 0 height. I fixed it by explicitly setting height for SelectInput:

<SelectInput className="h-12" />
                        ^^^^

expo version: 52.0.47 gluestack-ui version: 3.0.0 react native version: 0.76.9

lauriLukkarinen avatar Sep 23 '25 09:09 lauriLukkarinen