hello-pangea / dnd

Beautiful and accessible drag and drop for lists with React.

Home Page:https://dnd.hellopangea.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support overlapping Droppables via z-index prioritization

oliver-goh opened this issue · comments

Expected behavior

Regarding Droppables that are overlapping, the Droppable with the highest z-index should be selected.

Related issues:

Actual behavior

The library does not support such behaviour, as can be seen here, it uses getFurthestAway when there are multiple candidates.

Steps to reproduce

Droppable of the same type wrapped by a parent Droppable.
See Before CodeSandbox in Demo

Suggested solution?

When there are multiple candidates, select candidate with highest zIndex. See #669

What version of React are you using?

^17.0.0

What version of @hello-pangea/dnd are you running?

16.3.0

What browser are you using?

Google Chrome

Demo

Before

https://codesandbox.io/s/overlapping-droppables-before-hts23l

Screen.Recording.2023-09-12.at.14.26.33.mov
After

https://codesandbox.io/s/overlapping-droppables-z-index-n833f6

Screen.Recording.2023-09-12.at.14.33.54.mov
commented

@oliver-goh, thank you for your suggestion. I'll do some investigation and see what I can do. I'm not making any promises, but hopefully, we'll be able to make improvements to the dropping mechanism when this scenario presents itself.