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

Change selected item style ? #252

Open
CharlotteRdn opened this issue Sep 17, 2020 · 3 comments
Open

Change selected item style ? #252

CharlotteRdn opened this issue Sep 17, 2020 · 3 comments

Comments

@CharlotteRdn
Copy link

Can I change the selected item style ? I mean get it bold and underlined (I just found selectedItemColor )

@Sanil2108
Copy link

Sanil2108 commented Oct 6, 2020

You can pass a function that returns JSX to the prop renderBase

@Temirtator
Copy link

@CharlotteRdn you need to set fontWeight: '500' to itemTextStyle

@TahaGitHub
Copy link

You can change selected item's style by using the "propsExtractor" key. 
Check package flow for "propsExtractor" set at items "Button" in the dropdown list;

react-native-material-dropdown >> src/component/ >> dropdown >> index.js
react-native-material-dropdown >> src/component/ >> item >> index.js

For example the style key in next code will change selected item to red.

propsExtractor={(item, index) => { return { style: { backgroundColor: item.value === "Week" ? "red" : "transparent" } } } }

Screenshot from 2022-09-20 22-41-09

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

4 participants