I am using react-material-ui-carousel and showing listing vertically like
.
Following is the code:
const chunk = (arr, size) =>
Array.from({ length: Math.ceil(arr.length / size) }, (v, i) =>
arr.slice(i * size, i * size + size)
);
const dummyData = [
{
displayName: 'Trupti',
isMuted: true,
isSpeaking: false,
userId: 1
},
{
displayName: 'AAA',
isMuted: true,
isSpeaking: false,
userId: 2
},
{
displayName: 'BBB',
isMuted: true,
isSpeaking: false,
userId: 3
},
{
displayName: 'CCC',
isMuted: true,
isSpeaking: false,
userId: 4
},
{
displayName: 'DDD',
isMuted: true,
isSpeaking: false,
userId: 5
},
{
displayName: 'EEE',
isMuted: true,
isSpeaking: false,
userId: 6
},
{
displayName: 'FFF',
isMuted: true,
isSpeaking: false,
userId: 7
},
{
displayName: 'GGG',
isMuted: true,
isSpeaking: false,
userId: 8
},
{
displayName: 'HHH',
isMuted: true,
isSpeaking: false,
userId: 9
},
{
displayName: 'JJJ',
isMuted: true,
isSpeaking: false,
userId: 10
},
{
displayName: 'KKK',
isMuted: true,
isSpeaking: false,
userId: 77
},
{
displayName: 'LLL',
isMuted: true,
isSpeaking: false,
userId: 12
},
{
displayName: 'MMM',
isMuted: true,
isSpeaking: false,
userId: 13
},
{
displayName: 'NNN',
isMuted: true,
isSpeaking: false,
userId: 14
}
]
const groupArray = chunk(dummyData, displayCard);
<Carousel
autoPlay={false}
navButtonsAlwaysVisible={true}
navButtonsAlwaysInvisible={isMobile}
cycleNavigation={false}
indicators={false}
className="participants"
NextIcon
navButtonsWrapperProps={{ className: 'next-prev-btn' }}
NavButton={({ onClick, style, next, prev }) => {
return (
<span onClick={(e) => onClick(e)} style={style}>
<span>{next && <NavigateNextIcon />}</span>
<span>{prev && <NavigateBeforeIcon />}</span>
</span>
)
}}
>
{
groupArray.length > 0 && groupArray.map((e, index) => {
return <div className='participant' key={index} >{e.map((e) => {
return <ParticipantCardComponent key={e.displayName} name={e.displayName} isMuted={e.isMuted} isSpeaking={e.isSpeaking} acsUserId={e.userId} setError={setError} />
})}</div>
})
}
</Carousel>
On touch screen, it is moving from top to bottom but not able to scroll from down to up. I tried to solve this using CSS as well like moving prev and next at the top and bottom, but it is not working. Please help me here to find what I am doing wrong.