react-native-multipicker icon indicating copy to clipboard operation
react-native-multipicker copied to clipboard

bug: selectedValue is ignored, only selectedIndex is working

Open aksonov opened this issue 10 years ago • 2 comments

bug: selectedValue is ignored, only selectedIndex is working

aksonov avatar Sep 11 '15 09:09 aksonov

Can you clarify what you mean by "not working" and provide some example code to reproduce?

veddermatic avatar Sep 11 '15 21:09 veddermatic

Just check sources of multi-picker.ios.js (are you author?) - there is such property at all - only selectedIndexes:

    React.Children.forEach(props.children, function(child, index) {
      var items = []

      var selectedIndex = 0;
      if (child.props.selectedIndex) {
        selectedIndex = child.props.selectedIndex;
      }

      React.Children.forEach(child.props.children, function(child, idx) {
        items.push({label: child.props.label, value: child.props.value});
      });

      componentData.push(items);
      selectedIndexes.push(selectedIndex);
    });

    return { componentData, selectedIndexes, };

aksonov avatar Sep 17 '15 19:09 aksonov