Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

TextInput storing JSON string?

ANSWERED

I have a very simple TextInput right now:

<TextInput settingsKey='code' label='Code' />

In my companion code on the settingsStorage.change event, the event key is correct ("code"), however the newValue returns a JSON string "{"name":"1234"}" instead of the expected value "1234".  Is this expected behavior?

Best Answer
1 BEST ANSWER

Accepted Solutions

It's a known issue and we'll be looking to fix this in the future.

View best answer in original post

Best Answer
7 REPLIES 7

It's a known issue and we'll be looking to fix this in the future.

Best Answer

Is this fixed?  

Best Answer
0 Votes

Is there a workaround?

Best Answer
0 Votes

I am using this workaround

        <TextInput
          label="IP:PORT"
          value={props.settings.address}
          onChange={value => props.settingsStorage.setItem('address', value.name)}
        />

 

Best Answer
0 Votes

Still not working correctly?

Best Answer

Has it been fixed with SDK 6? SDK 4.3 still has this issue especially using a for loop for multiple contacts 

[ '{"name":"+"}', '+1212', '+1212', '+1212' ]    

 Where the first retrieved has this issue and then the rest don't. It creates a consistency issue.

 

Best Answer

Using .name on those values returns null, because it should be ."name" which returns a error

Best Answer
0 Votes