From 198599a5356464b8132f9da9eaf75db0b3af8907 Mon Sep 17 00:00:00 2001 From: muhammed sanjith <46193060+sanjithmsk@users.noreply.github.com> Date: Mon, 21 Feb 2022 11:24:47 +0530 Subject: [PATCH] Update TimePicker.android.js commented the code to update index in al functions to avoid android auto scrolling issue this.setState({selectedHourIndex: position}). this.setState({selectedHourIndex: position}) , this.setState({selectedMinuteIndex: position}) --- src/TimePicker.android.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/TimePicker.android.js b/src/TimePicker.android.js index 520489b4..7f47ed84 100644 --- a/src/TimePicker.android.js +++ b/src/TimePicker.android.js @@ -103,7 +103,7 @@ export default class TimePicker extends React.Component { } onHourSelected = (position: number) => { - this.setState({selectedHourIndex: position}) + //this.setState({selectedHourIndex: position}) const { selectedDate, hours } = this.state const selectedHour = hours[position] @@ -119,14 +119,14 @@ export default class TimePicker extends React.Component { } onMinuteSelected = (position: number) => { - this.setState({selectedMinuteIndex: position}) + //this.setState({selectedMinuteIndex: position}) const selectedDate = this.state.selectedDate selectedDate.setMinutes(Number(this.state.minutes[position])) this.onTimeSelected(selectedDate) } onAmSelected = (position: number) => { - this.setState({selectedAmIndex: position}) + //this.setState({selectedHourIndex: position}) const selectedDate = this.state.selectedDate const time12format = hourTo12Format(selectedDate.getHours()) const newTime12Format = `${time12format[0]} ${getAmArray()[position]}` @@ -152,4 +152,4 @@ const styles = StyleSheet.create({ width: 150, flex: 1, }, -}) \ No newline at end of file +})