Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: don't work: no label and no value #536

Open
332lfgb6 opened this issue Dec 2, 2023 · 8 comments
Open

bug: don't work: no label and no value #536

332lfgb6 opened this issue Dec 2, 2023 · 8 comments

Comments

@332lfgb6
Copy link

332lfgb6 commented Dec 2, 2023

import React, { useState } from "react";
import { Picker } from "@react-native-picker/picker";
import { Text } from "react-native";

const CompPicker = () => {
  const [selectedLanguage, setSelectedLanguage] = useState();

  return (
    <>
      <Picker
        mode="dropdown"
        selectedValue={selectedLanguage}
        onValueChange={(itemValue, itemIndex) => setSelectedLanguage(itemValue)}
      >
        <Picker.Item label="Java" value="java" />
        <Picker.Item label="JavaScript" value="js" />
      </Picker>
      <Text style={{ marginTop: 100 }}>zzz</Text>
    </>
  );
};

export default CompPicker;

image

@AlperenLogo
Copy link

I have same issue.
Please Help!

@PhilipRudzinsky
Copy link

Same issue

@nzeris
Copy link

nzeris commented Dec 8, 2023

I have the same issue. ver 2.5.1 seems to work for me

@dbatrakov1
Copy link

I added the prop style={{ fontSize: 14 }}, and it works for me:
<Picker.Item label={item} value={item} key={item} style={{ fontSize: 14 }} />

@dancosta-fed
Copy link

style={{ fontSize: 14 }}

This works for me! Thank you!

@LushawnDev
Copy link

I added the prop style={{ fontSize: 14 }}, and it works for me: <Picker.Item label={item} value={item} key={item} style={{ fontSize: 14 }} />

Setting font size also worked for me - glad I checked out the issues tab! Thank you 🙌🏻

@RafaelCENG
Copy link

RafaelCENG commented Dec 22, 2023

fontSize working but I cant do it on all my pickers.
Any chance they will release a fix?

@jmarks-joshua
Copy link

jmarks-joshua commented Feb 6, 2024

the fontSize has made no difference to mine.

Edit: I am using expo and once I created a new development build it worked just fine. Must have been a mismatch of native and javascript versions I guess.

hgray-instawork added a commit to Instawork/hyperview that referenced this issue Mar 20, 2024
Updating @react-native-picker/picker from 2.4.0 to 2.6.1

- [updated package references]()
- [chore run `yarn`]()
- [updated demo package references]()
- [chore run `yarn` in demo]()
- [Resolved Android render issues]()

On Android, starting after v2.5.1, an issue occurs where a zero font
size is used for the picker. See notes:
react-native-picker/picker#536

Upgrading Expo seems to resolve the issue. However, we decided that it
would be better to include a fix in our wrapper.
- A default fontSize has been added to `<Picker.item>`
- iOS is not affected by this issue and has not been changed


Illustration of bug:
https://github.com/Instawork/hyperview/assets/127122858/71029ef9-c335-4ef1-bdcb-ef3272dac9b5


| v2.4.0 | v2.6.2 (w/ 16 default) |
| -- | -- |
|
![v-2-4-0](https://github.com/Instawork/hyperview/assets/127122858/590b0836-66d1-4af8-a0f2-34bf41dd5d39)
|
![v-2-6-0-size16](https://github.com/Instawork/hyperview/assets/127122858/19c5d52a-d425-413f-8a3c-148eba1dbc8d)
|





Asana: https://app.asana.com/0/0/1206718044236459/f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants