-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add seconds to TimePicker #11231
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
base: dev
Are you sure you want to change the base?
Add seconds to TimePicker #11231
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #11231 +/- ##
==========================================
+ Coverage 91.08% 91.10% +0.01%
==========================================
Files 436 436
Lines 14143 14173 +30
Branches 2731 2737 +6
==========================================
+ Hits 12882 12912 +30
+ Misses 639 638 -1
- Partials 622 623 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Description
fixes #4644
Hi MudBlazor maintainer(s)!
I hope you will consider this PR, I wanted to be able the seconds in the TimePicker component, so thought I would have a go at it myself
I made several changes:
TimeEditMode
allowsTimeEditMode
HoursMinutes
: only hours and minutes are editableMinutesSeconds
: only minutes and seconds are editableSecondsOnly
: only seconds are editableHoursVisible
andSecondsVisible
to change whether the hours and seconds are visible in the picker toobarSecondSelectionStep
which controls the step for seconds in the same wayMinuteSelectionStep
does for minutesI also fixed a related issue where the
OpenTo
was not being set correctly based on theTimeEditMode
whenPickerVariant
was set toStatic
. This was becauseOnPickerOpenedAsync
was never being called to set it correctly so it always opened to the default value forOpenTo
which is hours. To fix this I made currentView nullable and set it inOnParametersSet
based on theTimeEditMode
.I know it says to have only one issue per PR, but I thought this was so closely related that it might be allowed to be added, but can create a separate PR if this is a hard rule
One thing I didn't add is a way of keyboard navigation for the seconds part, which I notice is there for hours and minutes. I did this mainly because I wasn't 100% sure which path to take. My main thought was to use ctrl+shft+arrow, but don't know if that might clash with other browser keybindings I'm not aware of
How Has This Been Tested?
I tested this using the Docs project and also an extra project I added locally for testing, but I've also added some unit tests
Type of Changes
Standard usage
HoursVisible and SecondsVisible
Layout before and after
Before
After
Checklist
dev
).