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

Time picker bug #279

Open
PranavMasekar opened this issue Jan 30, 2025 · 3 comments · May be fixed by #280
Open

Time picker bug #279

PranavMasekar opened this issue Jan 30, 2025 · 3 comments · May be fixed by #280
Assignees
Labels
accepted A valid and reproducible issue bug Something isn't working

Comments

@PranavMasekar
Copy link

Steps to reproduce

  1. Copy the example time picker from docs
  2. Put just 4 in the hour and observe the change in controller

Expected results

  1. Even if the input is not two digit it should recognise the correct value

Actual results

  1. Time picker doesn't recognised the hour value as 4 but instead returned null

shadcn_ui version

0.18.5

Platform

iOS

Code sample

Code sample
ConstrainedBox(
            constraints: const BoxConstraints(maxWidth: 600),
            child: ShadTimePicker.period(
              spacing: 10,
              gap: 10,
              initialDayPeriod: DayPeriod.am,
              controller: _timePickerController,
              onChanged: (time) {
                setState(() {});
              },
            ),
          ),

Screenshots or Video

Screenshots / Video demonstration

Image

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.3, on macOS 15.2 24C101 darwin-arm64, locale
    en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version
    35.0.0-rc3)
[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.95.2)
[✓] Connected device (4 available)
[✓] Network resources

• No issues found!
@PranavMasekar PranavMasekar added bug Something isn't working triage Issues that need assessment and prioritization labels Jan 30, 2025
@nank1ro
Copy link
Owner

nank1ro commented Jan 30, 2025

This is because each field needs two digits. If you need 4 as hour, the user has to type 04, if the user needs 15 has to type 15.
If you pay attention, the 0 before 4 is a placeholder, it is not in black.

@nank1ro nank1ro removed the triage Issues that need assessment and prioritization label Jan 30, 2025
@nank1ro nank1ro linked a pull request Jan 30, 2025 that will close this issue
@nank1ro
Copy link
Owner

nank1ro commented Jan 30, 2025

@PranavMasekar Please try the following branch and let me know if this satisfies your expectations

shadcn_ui:
    git:
      url: https://github.com/nank1ro/flutter-shadcn-ui
      ref: fix/time-picker-controller

@nank1ro nank1ro added the accepted A valid and reproducible issue label Jan 30, 2025
@nank1ro nank1ro self-assigned this Jan 30, 2025
@PranavMasekar
Copy link
Author

Sorry for late reply

It does solves my issue.

Will it be part of next release ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted A valid and reproducible issue bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants