Closed greenais closed 5 years ago
I can not reproduce this with Expo snack. When I set selectTextStyle={{ color: "red" }}
, the color is changed to red when I select an item in the modal: https://snack.expo.io/@mikaello/selecttextstyle-demo
Can you please provide a minimal example reproducing the behaviour?
1.1.0 introduced a change that may have affected this. Previously, selectTextStyle
applied all the time, but the recent change applies the style only on selection.
https://github.com/peacechen/react-native-modal-selector/blob/75a31d0cd12a152d445e9d6051d47d353b2baf44/index.js#L277
This was done for the new initValueTextStyle
prop. It looks like a regression.
@mikaello I don't use Expo, my project is pure RN with debugging in Android simulator. Tested release bundle on several real devices - all the same: text style props has no effect. I was surprised when saw this change in my UI after upgrade - thought that there were some changes in API, but when checked - no changes. Code is as provided above - just copypaste form my IDE. Other style props work as expected, no changes. BTW, style remains the same even after selecting item in modal. Style isn't applied before and after selection - remains the same .
@greenais
Would you try using the initValueTextStyle
prop?
@peacechen initValueTextStyle works, thank you! My issue solved. selectTextStyle has no effect still, I even removed it completely
Passing style to selectTextStyle prop has no effect for me in the most recent version. Text stays small and gray. In previous version (1.0.3) same code worked.
Used in default mode:
"react-native": "0.60.5", "react-native-modal-selector": "1.1.1",
Any suggestions, perhaps?