diff --git a/packages/components/src/mobile/bottom-sheet/cycle-picker-cell.native.js b/packages/components/src/mobile/bottom-sheet/cycle-picker-cell.native.js index 431b86cdc7eaa..489464807827a 100644 --- a/packages/components/src/mobile/bottom-sheet/cycle-picker-cell.native.js +++ b/packages/components/src/mobile/bottom-sheet/cycle-picker-cell.native.js @@ -8,20 +8,16 @@ import { findIndex } from 'lodash'; import Cell from './cell'; export default function BottomSheetCyclePickerCell( props ) { - const { - value, - options, - onChangeValue, - ...cellProps - } = props; + const { value, options, onChangeValue, ...cellProps } = props; - const cycleOptionValue = () => { - return options[ ( findIndex( options, [ 'value', value ] ) + 1 ) % options.length ].value; + const nextOptionValue = () => { + const selectedOptionIndex = findIndex( options, [ 'value', value ] ); + return options[ ( selectedOptionIndex + 1 ) % options.length ].value; }; return ( onChangeValue( cycleOptionValue() ) } + onPress={ () => onChangeValue( nextOptionValue() ) } editable={ false } value={ options[ findIndex( options, [ 'value', value ] ) ].label } { ...cellProps }