No labels, initValue doesn't work
See original GitHub issueFor some reason initValue doesn’t work. No label appear even when I’ve selected a value.
Code:
<ModalPicker
data={GLOBALS.FRANVARO_VALUE_LISTS.REASONS}
initValue="Välj en anledning"
onChange={(option) => {
GLOBALS.FRANVARO.REASON = option.label;
GLOBALS.FRANVARO.REASON_SELECTED = true;
}}
/>
<ModalPicker
data={GLOBALS.FRANVARO_VALUE_LISTS.LENGTHS}
initValue="Välj antal timmar"
onChange={(option) => {
GLOBALS.FRANVARO.LENGTH = option.label;
GLOBALS.FRANVARO.LENGTH_SELECTED = true;
}}
/>
<ModalPicker
data={GLOBALS.FRANVARO_VALUE_LISTS.DAYS}
initValue="Välj en dag"
onChange={(option) => {
GLOBALS.FRANVARO.DAY = option.label;
GLOBALS.FRANVARO.DAY_SELECTED = true;
}}
/>
I had this code working before updating to RN 0.40.
The modal and picker itself is working fine. The lists are rendered as intended and the value itself is being stored correctly and is recieved by my API like intended. The only issue is the label.
Any ideas?
Issue Analytics
- State:
- Created 7 years ago
- Comments:6
Top Results From Across the Web
swift 3 error : Argument labels '(_:)' do not match any available ...
NSNumber is calling NSNumber.init( value: X ) method to instantiate a NSNumber object. "Argument labels ' (_:) ' do not match any available...
Read more >No Labels
We are No Labels and we believe in an America where every voice counts. We believe excellent minds lie on the left and...
Read more >Formik does not re-render when initialValues change #811
enableReinitialize still doesn't work for me. The state changes but, inner values does not changes. My code: <Formik initialValues= ...
Read more >Working with labels - Business Central | Microsoft Learn
When Locked is set to true, the label should not be translated. Default value is false. MaxLength, Integer, Determines how much of the...
Read more >Why {!$Label.c.myLabelName} is not working in lightning ...
Does the org where the CL does not work have a namespace? · No, there are no namespaces on both orgs.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
WorkAround!
ModalPicker can take a children which override the default button (which doesn’t show the init value) You can give this as the child:
@Mjuk-Biltvatt So something like that for you
which will display your inital value if you havent selected yet. Need some styling and you can make it as beautiful as you want 😃
Thanks for this!