05-06-2020 06:55
05-06-2020 06:55
Hi, I'm working on my clockface settings and I need to disable some options in a select field.
I tried by filtering options and displaying only those ones are enabled, but due to the fact that the Select component manage its value using the index of the option and not his value (Link to docs), this cause a lot of problem:
TypeError: Cannot read property 'name' of undefined
I tried to crack down on the problem by changing manually the indexes or by using the onSelection method but the method is not documented anywhere and I decided to find another solution.
I tried different solutions, using renderItem to manually handle the selection, displaying only the enabled options, edit the payload and set manually the values. None of them seems to work.
So, someone know how I can disable some options, so the users can select them? Thanks
Something like this (Nothing is enabled, Weather and Battery are disabled):
03-14-2022 21:28
03-14-2022 21:28
Hi, I met same problem now and I resolved this problem.
I hope you have resolved this problem, but I wrote the solution because other people may get same problem.
A part of code of sample code ( https://dev.fitbit.com/build/reference/settings-api/) has a mistake.
label={`Selection`}
This code should be changed to `label="Selection"`. I don't know why but I guess jsx compiler may translate {`Selection`} to Selection.name according to the error message.
If this solution cannot resolve your problem. Could you please share a part of your code?
Thank you.