IssueRaiser

Support for nested scroll containers

Adding support for n-level deep scroll containers. Currently, only a single level is supported # Current plan This plan will allow for nested scroll containers, and also improve the performance of scroll updates ## Collection (drag start) - Grab all of the `Droppable` elements - Take the first one and walk up the DOM tree. If the element is a scroll container then add a `data-*` attribute to it. (eg `data-react-beautiful-dnd-scroll-container=${index}`). Cache the element and its result during the collection - When the `node.parentElement` is `null` then move onto the next `Droppable`. If an element is found that has previously been investigated then skip the rest of the upwards search. Use any previously found scroll parent ancestry. - When visiting an element an we also need to check to see if the element is `position:fixed` for our `position:fixed` support ## Storage while dragging - When storing a `Droppable` we will keep a map (or linked list) that registers a `Droppable`s scroll containers. - A droppable's frame will need to be updated when any of the ancestry changes - When calculating droppable displacement internally, all of the ancestry will need to be taken into account ## Updates (scroll events) A single scroll listener is added to the `window` as a `capture:true` listener. This will capture all scroll events. - If the source of a scroll event is a scroll container that has a `data-react-beautiful-dnd-scroll-container` attribute then trigger an action to

Posted by alexreardon on Oct 2, 2017, 7:55 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.4,500 issues0 comments

support (Other)

Support for nested scroll containers

alexreardonOct 2, 2017, 7:55 PM

Adding support for n-level deep scroll containers. Currently, only a single level is supported # Current plan This plan will allow for nested scroll containers, and also improve the performance of scroll updates ## Collection (drag start) - Grab all of the `Droppable` elements - Take the first one and walk up the DOM tree. If the element is a scroll container then add a `data-*` attribute to it. (eg `data-react-beautiful-dnd-scroll-container=${index}`). Cache the element and its result during the collection - When the `node.parentElement` is `null` then move onto the next `Droppable`. If an element is found that has previously been investigated then skip the rest of the upwards search. Use any previously found scroll parent ancestry. - When visiting an element an we also need to check to see if the element is `position:fixed` for our `position:fixed` support ## Storage while dragging - When storing a `Droppable` we will keep a map (or linked list) that registers a `Droppable`s scroll containers. - A droppable's frame will need to be updated when any of the ancestry changes - When calculating droppable displacement internally, all of the ancestry will need to be taken into account ## Updates (scroll events) A single scroll listener is added to the `window` as a `capture:true` listener. This will capture all scroll events. - If the source of a scroll event is a scroll container that has a `data-react-beautiful-dnd-scroll-container` attribute then trigger an action to

Comments (0)

No comments yet. Start the discussion.

Comment on this issue