question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Time picker sometimes resets value to previous value after change

See original GitHub issue

Bug report

👋 Hello!

Summary

When using the Time mode, the value seems to jump to a previously selected value. I am using the iOS Simulator and have not been able to test it on a real device yet.

Environment info

System:
    OS: macOS 10.15.5
    CPU: (16) x64 AMD Ryzen 7 1700X Eight-Core Processor         
    Memory: 1.32 GB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.18.0 - ~/.nvm/versions/node/v12.18.0/bin/node
    Yarn: 1.22.4 - ~/.nvm/versions/node/v12.18.0/bin/yarn
    npm: 6.14.4 - ~/.nvm/versions/node/v12.18.0/bin/npm
  SDKs:
    iOS SDK:
      Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
  IDEs:
    Xcode: 11.5/11E608c - /usr/bin/xcodebuild
  npmPackages:
    react: ~16.9.0 => 16.9.0 
    react-native: https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz => 0.61.4

Library version: 2.2.2

Steps to reproduce

  • Use DateTimePickerModal with mode=“time”
  • Change minute value to say 25
  • Change it to say 50
  • Every now and then the time picker will reset the minute value to 25

Reproducible sample code

I have videos, but they are not very clear since they do not the pointer intent very well, it looks like I could just be dragging down again. I’ll work on providing more info.

Code used

const TimePicker = () => {
	const [isDatePickerVisible, setDatePickerVisibility] = useState(false)
	const [time] = useState(() => new Date())

	const showDatePicker = () => {
		setDatePickerVisibility(true)
	}

	const hideDatePicker = () => {
		setDatePickerVisibility(false)
	}

	const handleConfirm = (date: Date) => {
		hideDatePicker()
		console.log('date is', date)
	}

	return (
		<>
			<Button onPress={showDatePicker} title="Show date" />
			<DateTimePickerModal
				isVisible={isDatePickerVisible}
				testID="dateTimePicker"
				date={time}
				mode="time"
				onConfirm={handleConfirm}
				onCancel={hideDatePicker}
			/>
		</>
	)
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:18 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
kamilryszkowskicommented, Jun 30, 2020

Same issue, experiencing in “time” mode. Pasting below a gif to demonstrate - I am changing the hour from 00 to 03 as expected and then trying to change the minute from 00 to 58, where when I release my mouse (or finger when testing on a real device) it snaps back to the previous value.

The issue only seems to happen when I change a value shortly after a previous change, before it has had a chance to “settle in”. Help would be much appreciated!

2020-06-30 10 16 35

4reactions
vonovakcommented, Jul 28, 2020

🎉 This issue has been resolved in version 2.6.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

Time picker sometimes resets value to previous value after ...
Bug report Hello! Summary When using the Time mode, the value seems to jump to a previously selected value. I am using the...
Read more >
Datetimepicker value resets on incorrect submit and page ...
I want the value of the datetimepicker to persist on page refresh, and not be reset to default. The value (:deadline) is stored...
Read more >
Set Date time picker value to Previous value - MSDN - Microsoft
hi. I have Date time picker control for that I have created ValueChanged event. I am checking changed value with database if suppose...
Read more >
Reset timepicker lable to match time token values
My question is: How can I reset the timepicker Label text to match the radio button selected time range? Currently, if a user...
Read more >
Forms in HTML documents - W3C
A control's initial value does not change. Thus, when a form is reset, each control's current value is reset to its initial value....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found