Closed shivapersad closed 7 years ago
Update:
I am able to get the text to display "black" when I set a numeric value for the selectedIndex property in the constructor of the Component. If I use "undefined" or "null" the text remains gray.
I am doing this as the implementation for iOS and Android differ slightly. In iOS the hint isn't displayed in the spinner object but in Android the hint is displayed. I tried an approach where I would include the hint in the list of items but this lead to duplicate list items in Android but worked fine for iOS. I am also checking the value of the "selectedIndex" property to perform validation on the inputs for a form. Any advice on a solution to this issue is appreciated.
Is it possible to hide the "hint" text when I click in the Dropdown for Android? I think that would be the best solution at this point in time.
Hey @shivapersad , i cannot simulate this color problem with the demo app. I've tried both setting the selected index from code and from the user selecting something. In both cases the color was correctly changed to whatever I have in CSS.
As for the hint not displaying on android, you need to set the hint to null
. See https://github.com/PeterStaev/NativeScript-Drop-Down/issues/67 for more details.
Your suggestion works. Thanks for the assistance.
On iOS I have created a Dropdown instance. I have a hint being displayed for the Dropdown. When I interact with the Dropdown and select a value the color of the text does not change from gray to black (I have a CSS property set on color to black).
Dropdown with hint displayed:
Dropdown with value changed:
What could be the reason for this as the Android version works perfectly. Thanks.