Skip to content
This repository was archived by the owner on Oct 21, 2024. It is now read-only.

Commit 554e78f

Browse files
committed
Merge PR clauderic#484 - Add disableAutoscroll
2 parents 96b17c1 + 7e849b0 commit 554e78f

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
<a name="1.5.4"></a>
6+
7+
## [1.5.4](https://github.com/clauderic/react-sortable-hoc/compare/v1.5.3...v1.5.4) (2019-02-07)
8+
9+
### Bug Fixes
10+
11+
- overflow bug while dragging an item upwards in a grid ([1a2c87e](https://github.com/clauderic/react-sortable-hoc/commit/1a2c87e))
12+
- virtualized collection grid bug ([a57975c](https://github.com/clauderic/react-sortable-hoc/commit/a57975c))
13+
14+
<a name="1.5.3"></a>
15+
16+
## [1.5.3](https://github.com/clauderic/react-sortable-hoc/compare/v1.1.0...v1.5.3) (2019-01-25)
17+
18+
### Bug Fixes
19+
20+
- omit spreading helperContainer prop on WrappedComponent ([#497](https://github.com/clauderic/react-sortable-hoc/issues/497)) ([12bafdf](https://github.com/clauderic/react-sortable-hoc/commit/12bafdf))
21+
522
<a name="1.5.2"></a>
623

724
## [1.5.2](https://github.com/clauderic/react-sortable-hoc/compare/v1.5.1...v1.5.2) (2019-01-22)

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ There are already a number of great Drag & Drop libraries out there (for instanc
122122
| getContainer | Function | | Optional function to return the scrollable container element. This property defaults to the `SortableContainer` element itself or (if `useWindowAsScrollContainer` is true) the window. Use this function to specify a custom container object (eg this is useful for integrating with certain 3rd party components such as `FlexTable`). This function is passed a single parameter (the `wrappedInstance` React element) and it is expected to return a DOM element. |
123123
| getHelperDimensions | Function | [Function](https://github.com/clauderic/react-sortable-hoc/blob/master/src/SortableContainer/index.js#L74-L77) | Optional `function({node, index, collection})` that should return the computed dimensions of the SortableHelper. See [default implementation](https://github.com/clauderic/react-sortable-hoc/blob/master/src/SortableContainer/index.js#L74-L77) for more details |
124124
| helperContainer | HTMLElement \| Function | `document.body` | By default, the cloned sortable helper is appended to the document body. Use this prop to specify a different container for the sortable clone to be appended to. Accepts an `HTMLElement` or a function returning an `HTMLElement` that will be invoked before right before sorting begins |
125+
| disableAutoscroll | Boolean | `false` | Disables autoscrolling while dragging |
125126

126127
\* `OffsetValue` can either be a finite `Number` or a `String` made up of a number and a unit (`px` or `%`).
127128
Examples: `10` (which is the same as `"10px"`), `"50%"`

src/SortableContainer/index.js

+8
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export default function sortableContainer(
8282
width: node.offsetWidth,
8383
height: node.offsetHeight,
8484
}),
85+
disableAutoscroll: false,
8586
};
8687

8788
static propTypes = {
@@ -121,6 +122,7 @@ export default function sortableContainer(
121122
? PropTypes.any
122123
: PropTypes.instanceOf(HTMLElement),
123124
]),
125+
disableAutoscroll: PropTypes.bool,
124126
};
125127

126128
static childContextTypes = {
@@ -798,6 +800,12 @@ export default function sortableContainer(
798800
}
799801

800802
autoscroll = () => {
803+
const {disableAutoscroll} = this.props;
804+
805+
if (disableAutoscroll) {
806+
return;
807+
}
808+
801809
const translate = this.dragLayer.translate;
802810
const direction = {
803811
x: 0,

0 commit comments

Comments
 (0)