File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Expand file tree Collapse file tree 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).
4343- ** onReleaseRow** (function)<br />
4444` (key) => void ` <br />
4545Called when the active row was released.
46+ - ** onPressRow** (function)<br />
47+ ` (key) => void ` <br />
48+ Called when a row was pressed.
4649
4750####Methods
4851- ** 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 {
1818 // Will be called on long press.
1919 onActivate : PropTypes . func ,
2020 onLayout : PropTypes . func ,
21+ onPress : PropTypes . func ,
2122
2223 // Will be called, when user (directly) move the view.
2324 onMove : PropTypes . func ,
Original file line number Diff line number Diff line change @@ -199,6 +199,7 @@ export default class SortableList extends Component {
199199 location = { location }
200200 onLayout = { ! rowsLayouts ? this . _onLayoutRow . bind ( this , resolveLayout , key ) : null }
201201 onActivate = { this . _onActivateRow . bind ( this , key , index ) }
202+ onPress = { this . _onPressRow . bind ( this , key ) }
202203 onRelease = { this . _onReleaseRow . bind ( this , key ) }
203204 onMove = { this . _onMoveRow } >
204205 { renderRow ( {
@@ -440,6 +441,12 @@ export default class SortableList extends Component {
440441 }
441442 } ;
442443
444+ _onPressRow = ( rowKey ) => {
445+ if ( this . props . onPressRow ) {
446+ this . props . onPressRow ( rowKey ) ;
447+ }
448+ } ;
449+
443450 _onReleaseRow = ( rowKey ) => {
444451 this . _stopAutoScroll ( ) ;
445452 this . setState ( ( { activeRowKey} ) => ( {
You can’t perform that action at this time.
0 commit comments