fix: [v5] RenderStyle="Native" restricts input to 08:00–18:00 in FluentTimePicker
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start in FluentTimePicker.razor.cs, specifically OnAfterRenderAsync and the copyToShadow calls for the native control. Reproduce the issue with the provided Razor sample and inspect the shadow input attributes. Done means Native mode accepts times outside 08:00–18:00 without the default min, max, or step restrictions, while the documented FluentUI behavior remains unchanged.
Written by the indexing model from the issue text.
Description
🐛 Bug Report
With RenderStyle="DatePickerRenderStyle.Native", FluentTimePicker still applies its default StartHour/EndHour/Increment to the native <input type="time"> as min="08:00", max="18:00", step="15". You can't enter any time before 08:00 or after 18:00.
This contradicts the TimePicker docs, which say:
If you want the user to be able to enter any time (any hour or any minute), you must enable the mode
RenderStyle="Native".
and, for the Native render style:
The following parameters are ignored:
Culture,StartHour,EndHour,Increment,DisabledTimeFunc.
💻 Repro or Code Sample
<FluentTimePicker RenderStyle="DatePickerRenderStyle.Native" @bind-Value="@Time" />
@code {
TimeOnly Time = new(9, 0);
}
- Try to enter
20:00or07:00. - The browser won't accept it. The native picker won't go past 18:00 or below 08:00, and the input is
:invalidif a value is typed. - Inspect the inner
input[part="control"]in the shadow root: it hasmin="08:00" max="18:00" step="15".
🤔 Expected Behavior
In Native mode, any time of day can be entered, as the docs describe. StartHour/EndHour/Increment should not restrict the native input.
😯 Current Behavior
FluentTimePicker.razor.cs → OnAfterRenderAsync (current dev branch, also in 5.0.0-rc.5-26219.1) copies all three onto the shadow control whenever the style isn't FluentUI:
// Set the attribute min/max/step on the shadow "control" element.
await JSRuntime.InvokeVoidAsync("Microsoft.FluentUI.Blazor.Utilities.Attributes.copyToShadow",
Id, "[part='control']", "min", DefaultTime.AddHours(StartHour).ToString("HH:mm", CultureInfo.InvariantCulture));
await JSRuntime.InvokeVoidAsync("Microsoft.FluentUI.Blazor.Utilities.Attributes.copyToShadow",
Id, "[part='control']", "max", DefaultTime.AddHours(EndHour).ToString("HH:mm", CultureInfo.InvariantCulture));
await JSRuntime.InvokeVoidAsync("Microsoft.FluentUI.Blazor.Utilities.Attributes.copyToShadow",
Id, "[part='control']", "step", Increment);
Two side effects:
- The defaults are 8 and 18, so every Native picker is limited to 08:00–18:00 unless the caller overrides both.
stepon<input type="time">is in seconds, soIncrement = 15becomes a 15-second step, not 15 minutes.
Setting StartHour="0" EndHour="23" only partly works around it: 23:01–23:59 is still blocked. EndHour="24" formats as "00:00", which puts max below min.
💁 Possible Solution
Either:
- don't copy
min/max/stepin Native mode, matching the docs, or - only copy them when the caller explicitly set
StartHour/EndHour/Increment. Ifstepis kept, convert it to seconds (Increment * 60) and allowmaxto reach23:59.
If the current behaviour is intended, the docs need updating, and there should be a way to get an unrestricted Native picker.
Our workaround for now is a subclass that re-applies min="00:00" max="23:59" step="60" after base.OnAfterRenderAsync(firstRender).
🔦 Context
We use Native time pickers for staff shift start/end times. Evening and overnight shifts (e.g. 22:00–06:00) couldn't be entered at all.
🌍 Your Environment
- OS & Device: Windows / Linux / Android, PC and phone
- Browser: Google Chrome, Microsoft Edge
- .NET 10 and Microsoft.FluentUI.AspNetCore.Components 5.0.0-rc.5-26219.1 (code unchanged on current
dev)
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 483
- Avg merge
- 15h 36m
- Merged PRs (30d)
- 77
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/fluentui-blazor
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/fluentui-blazor#5364 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
microsoft/fluentui-blazor#5365 ·
Maintainers usually reply within 1 day
-
[v5] FluentDatePicker year navigation stops before MinDate and changes after switching calendar viewsPossibly taken @dvoituron claimed this 9 days ago. Openstatus:needs-investigation v5
microsoft/fluentui-blazor#5311 · 1 assignee ·
Maintainers usually reply within 1 day
-
bug v5
Difficulty 3/5 1-2 days Newbie friendliness 68/100
microsoft/fluentui-blazor#5281 · 1 comment ·
Maintainers usually reply within 1 day
-
feature v5
Difficulty 5/5 Over a week Newbie friendliness 35/100
microsoft/fluentui-blazor#5277 · 5 comments ·
Maintainers usually reply within 1 day
All issues in microsoft/fluentui-blazor
Similar issues
-
[Simple] NavigationBar primary commands do not render AppBarButton.Content when it is a UIElementOpencontrol/navigationbar kind/bug triage/untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
unoplatform/uno.toolkit.ui#1652 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
microsoft/copilot-camp#1053 ·
Maintainers usually reply within 1 day
-
bug effort:S P3
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
nightscout/nocturne#1861 ·
Maintainers usually reply within 1 day
-
agentic-workflows area/Docs partner/agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
.NET triage
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
microsoft/agent-framework#8811 ·
Maintainers usually reply within 1 day