react-native-multiple-choice icon indicating copy to clipboard operation
react-native-multiple-choice copied to clipboard

use two multiple-choice in one page

Open kaola8246 opened this issue 9 years ago • 5 comments

when use two multiple-choice in one page, one is setted to maxSelectedOptions=1 and other is setted to maxSelectedOptions =5 ,then the two multiple-choice both have maxSelectedOptions =5 actions , is there some setting issues?

kaola8246 avatar Mar 10 '16 17:03 kaola8246

I have make it work will by fix the bug, i add a new state of maxSelectedOptions, in the state pool,and init it,

kaola8246 avatar Mar 10 '16 17:03 kaola8246

@kaola8246 Thanks for reporting and fixing this. Please make a pull request and I'm happy to merge it.

d-a-n avatar Mar 10 '16 17:03 d-a-n

@d-a-n im sorry, i think i have not fix it , when i test it , i find it still not right , Could you give me some advise?

kaola8246 avatar Mar 11 '16 01:03 kaola8246

@d-a-n at last , i have fixed it , just change the line 22 just like this var tempSelectedOptions = []; if(this.props.selectedOptions) { tempSelectedOptions = this.props.selectedOptions.slice(0) } this.state = { dataSource: ds.cloneWithRows(this.props.options), selectedOptions: tempSelectedOptions, }; this will copy a new selectedOptions to the companent. then it been fixed

kaola8246 avatar Mar 11 '16 16:03 kaola8246

@kaola8246 I can't reproduce this behavior. Can you share the code that is not working for you?

iphone_6_-_iphone_6___ios_9_2__13c75_

d-a-n avatar Mar 15 '16 01:03 d-a-n