react-native-sectioned-multi-select
react-native-sectioned-multi-select copied to clipboard
[Question] Can you make the chipsWrapper scrollable
is it possible to make the chipsWrapper scrollable so that only the chips underneath scroll rather than wrapping thw whole multi select in a scroll view
This is only currentlly possible with customChipsRenderer prop.
Here's something you could play with, I think this is what you mean.
// ...
const ref = React.useRef()
return (
<SectionedMultiSelect
ref={ref}
customChipsRenderer={props => (
<ScrollView
style={{
height: 58,
width: '100%',
}}
contentContainerStyle={{
alignItems: 'center',
flexDirection: 'row',
flexWrap: 'wrap',
padding: 8,
}}>
{selectedItems.map(itemId => {
const item = items.find(({id}) => id === itemId);
return (
<View
style={{
marginRight: 10,
alignItems: 'center',
marginBottom: 6,
paddingVertical: 4,
backgroundColor: 'white',
borderRadius: 24,
flexDirection: 'row',
borderColor: props.colors.chipColor,
borderWidth: 1,
}}
key={item.id}>
<Text
style={{
fontSize: 16,
fontWeight: 'bold',
color: props.colors.chipColor,
marginLeft: 16,
}}>
{item.title}
</Text>
<TouchableOpacity
style={{padding: 4, marginRight: 8}}
onPress={() => ref.current?._removeItem(item)}>
<Icon name="close" size={18} />
</TouchableOpacity>
</View>
);
})}
</ScrollView>
)}
// ...
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.