Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dismissing the TimePickerModal does not reset the time to the initial value #446

Open
ericpoulinnz opened this issue Jan 22, 2025 · 3 comments
Labels
bug Something isn't working needs repro Needs reproducible example

Comments

@ericpoulinnz
Copy link
Contributor

Current behaviour

When opening a time picker that has already been opened and dismissed, the value shown is the value that was entered before dismissing, not the actual value saved.

Expected behaviour

When dismissing the modal (i.e. not confirming/saving the value), it should reset back to the initial input. This works as expected for the DatePicker.

How to reproduce?

  1. Open the TimePickerModal
  2. Change the minutes or hour value
  3. Dismiss the modal (not confirming/saving)
  4. Open the TimePickerModal
  5. Dismissed value is shown
@ericpoulinnz ericpoulinnz added the bug Something isn't working label Jan 22, 2025
@iM-GeeKy iM-GeeKy added the needs repro Needs reproducible example label Jan 26, 2025
Copy link
Contributor

Hey! Thanks for opening the issue. Can you provide a minimal repro which demonstrates the issue? Posting a snippet of your code in the issue is useful, but it's not usually straightforward to run. A repro will help us debug the issue faster. Please try to keep the repro as small as possible. The easiest way to provide a repro is on snack.expo.dev. If it's not possible to repro it on snack.expo.dev, then you can also provide the repro in a GitHub repository.

@ericpoulinnz
Copy link
Contributor Author

@iM-GeeKy adding 'needs repro' is a bit odd here given I have added the repro steps.

The min repro is in the examples on the website.
https://www.reactnativepaperdates.com / https://github.com/web-ridge/react-native-paper-dates/blob/master/example/app/index.tsx

Just any TimePickerModal and then the repro steps in the OP

      <TimePickerModal
        locale={locale}
        visible={timeOpen}
        onDismiss={onDismissTime}
        onConfirm={onConfirmTime}
        hours={time.hours}
        minutes={time.minutes}
      />

@RichardLindhout
Copy link
Member

Maybe we just need to hide the modal as whole or the children if not opened

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs repro Needs reproducible example
Projects
None yet
Development

No branches or pull requests

3 participants