UNPKG

react-beautiful-dnd

Version:

Beautiful, accessible drag and drop for lists with React.js

17 lines (14 loc) 409 B
// @flow import { add } from './position'; import type { Position, ClosestScrollable, DroppableDimension, } from '../types'; export default (droppable: DroppableDimension, point: Position): Position => { const closestScrollable: ?ClosestScrollable = droppable.viewport.closestScrollable; if (!closestScrollable) { return point; } return add(point, closestScrollable.scroll.diff.value); };