File tree Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ gridstack.js API
102
102
* example ` dragInOptions: { appendTo: 'body', helper: 'clone', handle: '.grid-stack-item-content' } `
103
103
* ** Note** : if you have multiple grids, it's best to call ` GridStack.setupDragIn() ` with same params as it only need to be done once.
104
104
* ** Note2** : instead of 'clone' you can also pass your own function (get passed the event).
105
- - ` draggable ` - allows to override draggable options - see ` DDDragOpt ` . (default: ` {handle: '.grid-stack-item-content', appendTo: 'body'} ` )
105
+ - ` draggable ` - allows to override draggable options - see ` DDDragOpt ` . (default: ` {handle: '.grid-stack-item-content', appendTo: 'body', scroll: true } ` )
106
106
- ` dragOut ` to let user drag nested grid items out of a parent or not (default false) See [ example] ( http://gridstackjs.com/demo/nested.html )
107
107
- ` engineClass ` - the type of engine to create (so you can subclass) default to GridStackEngine
108
108
- ` float ` - enable floating widgets (default: ` false ` ) See [ example] ( http://gridstackjs.com/demo/float.html )
@@ -134,6 +134,7 @@ gridstack.js API
134
134
- ` handle ` ?: string - class selector of items that can be dragged. default to '.grid-stack-item-content'
135
135
- ` appendTo ` ?: string - default to 'body' (TODO: is this even used anymore ?)
136
136
- ` pause ` ?: boolean | number - if set (true | msec), dragging placement (collision) will only happen after a pause by the user. Note: this is Global
137
+ - ` scroll ` ?: boolean - default to 'true', enable or disable the scroll when an element is dragged on bottom or top of the grid.
137
138
138
139
### DDDragInOpt extends DDDragOpt
139
140
- ` helper ` ?: string | ((event: Event) => HTMLElement) - helper function when dropping (ex: 'clone' or your own method)
Original file line number Diff line number Diff line change @@ -2181,7 +2181,7 @@ export class GridStack {
2181
2181
if ( node . _temporaryRemoved ) return ; // handled by dropover
2182
2182
let distance = ui . position . top - node . _prevYPix ;
2183
2183
node . _prevYPix = ui . position . top ;
2184
- if ( ! this . opts . disableAutoScroll ) {
2184
+ if ( this . opts . draggable . scroll ) {
2185
2185
Utils . updateScrollPosition ( el , ui . position , distance ) ;
2186
2186
}
2187
2187
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export const gridDefaults: GridStackOptions = {
15
15
cellHeightThrottle : 100 ,
16
16
cellHeightUnit : 'px' ,
17
17
column : 12 ,
18
- draggable : { handle : '.grid-stack-item-content' , appendTo : 'body' } ,
18
+ draggable : { handle : '.grid-stack-item-content' , appendTo : 'body' , scroll : true } ,
19
19
handle : '.grid-stack-item-content' ,
20
20
itemClass : 'grid-stack-item' ,
21
21
margin : 10 ,
@@ -140,9 +140,6 @@ export interface GridStackOptions {
140
140
Note: only used by addGrid(), else your element should have the needed class */
141
141
class ?: string ;
142
142
143
- /** disallows the scroll when dragging or resizing a widget (default?: false) */
144
- disableAutoScroll ?: boolean ;
145
-
146
143
/** disallows dragging of widgets (default?: false) */
147
144
disableDrag ?: boolean ;
148
145
@@ -351,7 +348,7 @@ export interface DDDragOpt {
351
348
/** if set (true | msec), dragging placement (collision) will only happen after a pause by the user. Note: this is Global */
352
349
pause ?: boolean | number ;
353
350
/** default to `true` */
354
- // scroll?: boolean;
351
+ scroll ?: boolean ;
355
352
/** parent constraining where item can be dragged out from (default: null = no constrain) */
356
353
// containment?: string;
357
354
}
You can’t perform that action at this time.
0 commit comments