File tree 3 files changed +11
-0
lines changed
3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,9 @@ Called when a row was activated (user long tapped).
43
43
- ** onReleaseRow** (function)<br />
44
44
` (key) => void ` <br />
45
45
Called when the active row was released.
46
+ - ** onPressRow** (function)<br />
47
+ ` (key) => void ` <br />
48
+ Called when a row was pressed.
46
49
47
50
####Methods
48
51
- ** scrollBy(dy?, animated?)** scrolls by a given y offset, either immediately or with a smooth animation
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ export default class Row extends Component {
18
18
// Will be called on long press.
19
19
onActivate : PropTypes . func ,
20
20
onLayout : PropTypes . func ,
21
+ onPress : PropTypes . func ,
21
22
22
23
// Will be called, when user (directly) move the view.
23
24
onMove : PropTypes . func ,
Original file line number Diff line number Diff line change @@ -199,6 +199,7 @@ export default class SortableList extends Component {
199
199
location = { location }
200
200
onLayout = { ! rowsLayouts ? this . _onLayoutRow . bind ( this , resolveLayout , key ) : null }
201
201
onActivate = { this . _onActivateRow . bind ( this , key , index ) }
202
+ onPress = { this . _onPressRow . bind ( this , key ) }
202
203
onRelease = { this . _onReleaseRow . bind ( this , key ) }
203
204
onMove = { this . _onMoveRow } >
204
205
{ renderRow ( {
@@ -440,6 +441,12 @@ export default class SortableList extends Component {
440
441
}
441
442
} ;
442
443
444
+ _onPressRow = ( rowKey ) => {
445
+ if ( this . props . onPressRow ) {
446
+ this . props . onPressRow ( rowKey ) ;
447
+ }
448
+ } ;
449
+
443
450
_onReleaseRow = ( rowKey ) => {
444
451
this . _stopAutoScroll ( ) ;
445
452
this . setState ( ( { activeRowKey} ) => ( {
You can’t perform that action at this time.
0 commit comments