Open cmacdonnacha opened 3 years ago
Thank you @cmacdonnacha for opening this issue. I’ll have a look into it, once I’ve migrated the codebase to TypeScript. :slightly_smiling_face:
Excellent thanks @100terres. The main discussion and design plan is in this issue: https://github.com/atlassian/react-beautiful-dnd/issues/131. Thanks again for taking the time to lead the way on continuing on this awesome library!
FYI: https://github.com/atlassian/react-beautiful-dnd/issues/131#issuecomment-635862957
a few weeks ago when I encountered the problem in my side project I dived into the source code and I found there is a function that is looking for closest scroll parent. The scrolling is performed either on the window or on that scroll parent. If we could detect all scroll parents and put into an array, then scroll each step by step (depending on where the mouse pointer is) we could achieve expected behavior.
I need that feature too. I would be happy to help.
Is there any slack/discord or another communicator for this project?
Waiting for solution as well...
Any updates on this? or at least a way to remove the warning
This is a critical issue, any updates on this?
Any updates on this, I am able to scroll the container by using the mouseMove attribute on the scroll container, but the drag and drop feature doesn't work for the any region except the columns which were in the viewport before the scroll. How can I inform the library that the list has scrolled horizontally
How is it this going?
I solve this by wrapping my scrollable div inside the Droppable
by another div, and passing these:
<div ref={provided.innerRef} {...provided.droppableProps}>
I solve this by wrapping my scrollable div inside the
Droppable
by another div, and passing these:<div ref={provided.innerRef} {...provided.droppableProps}>
Could you please send whole sample.
Could you please send whole sample.
Previously I had this:
<Droppable
droppableId={s}
isDropDisabled={isDisabled && !isCurrentSource}
>
{(provided: DroppableProvided) => (
<CssScrollerDiv
{...scrollDivProps}
ref={(e) => {
scrollDivProps.ref(e)
provided.innerRef(e)
}}
style={{
minHeight: 300,
maxHeight: 650,
padding: 8,
rowGap: 4,
display: 'flex',
flexDirection: 'column',
...getDroppableStyles(
ticketTicketStatusChoicesColorMap1[s]?.secondary || ``,
droppableState || undefined
),
}}
defaultYScroller
{...provided.droppableProps}
>
{tickets?.map((ticket: $TSFixMe, i: number) => (
<ListItem
key={ticket.id}
id={ticket.id}
index={i}
isDragDisabled={isDisabled}
>
{(p) => (
<div {...p}>
<TicketCard
node={ticket}
cardProps={{
onClick: () => onTicketClick(ticket.id),
}}
/>
</div>
)}
</ListItem>
))}
{provided.placeholder}
{((loading && !tickets.length) || loadingMore) && (
<Skeleton style={{ marginTop: offset === 0 ? 0 : '1rem' }} />
)}
</CssScrollerDiv>
)}
</Droppable>
I converted it to this:
<Droppable
droppableId={s}
isDropDisabled={isDisabled && !isCurrentSource}
>
{(provided: DroppableProvided) => (
<div ref={provided.innerRef} {...provided.droppableProps}>
<CssScrollerDiv
{...scrollDivProps}
ref={(e) => {
scrollDivProps.ref(e)
}}
style={{
minHeight: 300,
maxHeight: 650,
padding: 8,
rowGap: 4,
display: 'flex',
flexDirection: 'column',
...getDroppableStyles(
ticketTicketStatusChoicesColorMap1[s]?.secondary || ``,
droppableState || undefined
),
}}
defaultYScroller
>
{tickets?.map((ticket: $TSFixMe, i: number) => (
<ListItem
key={ticket.id}
id={ticket.id}
index={i}
isDragDisabled={isDisabled}
>
{(p) => (
<div {...p}>
<TicketCard
node={ticket}
cardProps={{
onClick: () => onTicketClick(ticket.id),
}}
/>
</div>
)}
</ListItem>
))}
{provided.placeholder}
{((loading && !tickets.length) || loadingMore) && (
<Skeleton style={{ marginTop: offset === 0 ? 0 : '1rem' }} />
)}
</CssScrollerDiv>
</div>
)}
</Droppable>
So basically the div directly inside Droppable
had overflow-y init, I just wrapped that with a div
Could you please send whole sample.
Previously I had this:
<Droppable droppableId={s} isDropDisabled={isDisabled && !isCurrentSource} > {(provided: DroppableProvided) => ( <CssScrollerDiv {...scrollDivProps} ref={(e) => { scrollDivProps.ref(e) provided.innerRef(e) }} style={{ minHeight: 300, maxHeight: 650, padding: 8, rowGap: 4, display: 'flex', flexDirection: 'column', ...getDroppableStyles( ticketTicketStatusChoicesColorMap1[s]?.secondary || ``, droppableState || undefined ), }} defaultYScroller {...provided.droppableProps} > {tickets?.map((ticket: $TSFixMe, i: number) => ( <ListItem key={ticket.id} id={ticket.id} index={i} isDragDisabled={isDisabled} > {(p) => ( <div {...p}> <TicketCard node={ticket} cardProps={{ onClick: () => onTicketClick(ticket.id), }} /> </div> )} </ListItem> ))} {provided.placeholder} {((loading && !tickets.length) || loadingMore) && ( <Skeleton style={{ marginTop: offset === 0 ? 0 : '1rem' }} /> )} </CssScrollerDiv> )} </Droppable>
I converted it to this:
<Droppable droppableId={s} isDropDisabled={isDisabled && !isCurrentSource} > {(provided: DroppableProvided) => ( <div ref={provided.innerRef} {...provided.droppableProps}> <CssScrollerDiv {...scrollDivProps} ref={(e) => { scrollDivProps.ref(e) }} style={{ minHeight: 300, maxHeight: 650, padding: 8, rowGap: 4, display: 'flex', flexDirection: 'column', ...getDroppableStyles( ticketTicketStatusChoicesColorMap1[s]?.secondary || ``, droppableState || undefined ), }} defaultYScroller > {tickets?.map((ticket: $TSFixMe, i: number) => ( <ListItem key={ticket.id} id={ticket.id} index={i} isDragDisabled={isDisabled} > {(p) => ( <div {...p}> <TicketCard node={ticket} cardProps={{ onClick: () => onTicketClick(ticket.id), }} /> </div> )} </ListItem> ))} {provided.placeholder} {((loading && !tickets.length) || loadingMore) && ( <Skeleton style={{ marginTop: offset === 0 ? 0 : '1rem' }} /> )} </CssScrollerDiv> </div> )} </Droppable>
So basically the div directly inside
Droppable
had overflow-y init, I just wrapped that with a div
thank you very much! ur comment solve my problem.
Great idea to fork the dnd project! This has been raised a couple of times in the old repo so I think it would be a great first bug to fix. Basically horizontal scrolling doesn't work when you drag an item to the edge of the screen. It only appears to be an issue when the columns are also using vertical scrolling.