File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,10 @@ class Dropzone extends React.Component {
6767 } catch ( err ) {
6868 // continue regardless of error
6969 }
70+
71+ if ( this . props . onDragOver ) {
72+ this . props . onDragOver . call ( this , e ) ;
73+ }
7074 return false ;
7175 }
7276
@@ -310,6 +314,7 @@ Dropzone.propTypes = {
310314 onDropRejected : React . PropTypes . func ,
311315 onDragStart : React . PropTypes . func ,
312316 onDragEnter : React . PropTypes . func ,
317+ onDragOver : React . PropTypes . func ,
313318 onDragLeave : React . PropTypes . func ,
314319
315320 children : React . PropTypes . node , // Contents of the dropzone
Original file line number Diff line number Diff line change @@ -165,19 +165,23 @@ describe('Dropzone', () => {
165165 it ( 'should override onDrag* methods' , ( ) => {
166166 const dragStartSpy = spy ( ) ;
167167 const dragEnterSpy = spy ( ) ;
168+ const dragOverSpy = spy ( ) ;
168169 const dragLeaveSpy = spy ( ) ;
169170 const component = mount (
170171 < Dropzone
171172 onDragStart = { dragStartSpy }
172173 onDragEnter = { dragEnterSpy }
174+ onDragOver = { dragOverSpy }
173175 onDragLeave = { dragLeaveSpy }
174176 />
175177 ) ;
176178 component . simulate ( 'dragStart' ) ;
177179 component . simulate ( 'dragEnter' , { dataTransfer : { items : files } } ) ;
180+ component . simulate ( 'dragOver' , { dataTransfer : { items : files } } ) ;
178181 component . simulate ( 'dragLeave' , { dataTransfer : { items : files } } ) ;
179182 expect ( dragStartSpy . callCount ) . toEqual ( 1 ) ;
180183 expect ( dragEnterSpy . callCount ) . toEqual ( 1 ) ;
184+ expect ( dragOverSpy . callCount ) . toEqual ( 1 ) ;
181185 expect ( dragLeaveSpy . callCount ) . toEqual ( 1 ) ;
182186 } ) ;
183187
You can’t perform that action at this time.
0 commit comments