Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@spingee
Copy link
Contributor

@spingee spingee commented Nov 30, 2025

Hello,
This is followup for this PR #12028 , it was merged too fast :).
I fixed issue when it was able to move weird state with fixed year/month with keyboard nav.
Also updated docs with info about keyboard shortcuts

@mudbot mudbot bot changed the title Datepicker keyboard navigation followup MudDatePicker: Fix keyboard navigation with fixed year/month Nov 30, 2025
@mudbot mudbot bot added accessibility Accessibility concerns (ARIA, keyboard, focus, screen readers, contrast) bug Unexpected behavior or functionality not working as intended docs Web or code documentation or examples is the main focus tests Tests or test infrastructure is the main focus labels Nov 30, 2025
@danielchalmers danielchalmers removed docs Web or code documentation or examples is the main focus tests Tests or test infrastructure is the main focus labels Nov 30, 2025
Copilot finished reviewing on behalf of danielchalmers November 30, 2025 16:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes keyboard navigation issues in MudDatePicker when FixYear or FixMonth parameters are set, ensuring these constraints are respected during keyboard interactions. It also adds comprehensive accessibility documentation for keyboard shortcuts.

Key changes:

  • Added guard checks in navigation methods (MoveToNextYear, MoveToPreviousYear, MoveToNextMonth, MoveToPreviousMonth) to prevent changes when year/month are fixed
  • Refactored duplicate month navigation logic by adding parameters to existing methods
  • Added test coverage for FixYear and FixMonth keyboard navigation scenarios
  • Documented all keyboard shortcuts in an accessibility section

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
MudDatePicker.cs Added FixYear/FixMonth guards to navigation methods and refactored month navigation to accept step parameter
DatePickerTests.cs Added tests verifying keyboard navigation respects FixYear and FixMonth constraints
DatePickerPage.razor Added accessibility section documenting keyboard shortcuts (with some documentation errors)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 206 to 212
<td>Increment month/date in respective view</td>
</tr>
<tr>
<td>
<CodeInline>ArrowRight</CodeInline>
</td>
<td>Decrement month/date in respective view</td>
Copy link

Copilot AI Nov 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The descriptions for ArrowLeft and ArrowRight are swapped. Based on the code:

  • ArrowLeft decrements (moves to previous day/month)
  • ArrowRight increments (moves to next day/month)

The descriptions should be:

  • ArrowLeft: "Decrement month/date in respective view"
  • ArrowRight: "Increment month/date in respective view"
Suggested change
<td>Increment month/date in respective view</td>
</tr>
<tr>
<td>
<CodeInline>ArrowRight</CodeInline>
</td>
<td>Decrement month/date in respective view</td>
<td>Decrement month/date in respective view</td>
</tr>
<tr>
<td>
<CodeInline>ArrowRight</CodeInline>
</td>
<td>Increment month/date in respective view</td>

Positive FeedbackNegative Feedback
Copilot uses AI. Check for mistakes.
Comment on lines 230 to 236
<td>Increment month in date view</td>
</tr>
<tr>
<td>
<CodeInline>Shift+ArrowRight</CodeInline>
</td>
<td>Decrement month in date view</td>
Copy link

Copilot AI Nov 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The descriptions for Shift+ArrowLeft and Shift+ArrowRight are swapped. Based on the code:

  • Shift+ArrowLeft moves to previous month
  • Shift+ArrowRight moves to next month

The descriptions should be:

  • Shift+ArrowLeft: "Decrement month in date view"
  • Shift+ArrowRight: "Increment month in date view"
Suggested change
<td>Increment month in date view</td>
</tr>
<tr>
<td>
<CodeInline>Shift+ArrowRight</CodeInline>
</td>
<td>Decrement month in date view</td>
<td>Decrement month in date view</td>
</tr>
<tr>
<td>
<CodeInline>Shift+ArrowRight</CodeInline>
</td>
<td>Increment month in date view</td>

Positive FeedbackNegative Feedback
Copilot uses AI. Check for mistakes.

private void MoveToPreviousMonth()
private void MoveToPreviousMonth(int numberOfMonths = 1)

Copy link

Copilot AI Nov 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the extra blank line between the method signature and the opening brace for consistency with the rest of the codebase.

Suggested change

Positive FeedbackNegative Feedback
Copilot uses AI. Check for mistakes.
var datePicker = datePickerComponent.Instance;
await comp.InvokeAsync(() => datePicker.OnHandleKeyDownAsync(new KeyboardEventArgs() { Key = "Enter", Type = "keydown", }));
comp.WaitForAssertion(() => comp.FindAll("div.mud-picker-open").Count.Should().Be(1));
//try to select month outside fixed year in date view
Copy link

Copilot AI Nov 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment mentions "fixed year" but the test is for FixMonth. The comment should say "try to select month outside fixed month in date view" to accurately describe what the test is checking.

Suggested change
//try to select month outside fixed year in date view
//try to select month outside fixed month in date view

Positive FeedbackNegative Feedback
Copilot uses AI. Check for mistakes.
@ScarletKuro
Copy link
Member

ScarletKuro commented Nov 30, 2025

P.S. not to merge before #12177

@danielchalmers danielchalmers added the on hold Waiting until an external factor or future milestone (e.g., major release) is reached label Nov 30, 2025
@ScarletKuro ScarletKuro removed the on hold Waiting until an external factor or future milestone (e.g., major release) is reached label Dec 3, 2025
@danielchalmers
Copy link
Member

Hi @spingee, could you take another look with Copilot's feedback and merge conflicts?

@spingee
Copy link
Contributor Author

spingee commented Dec 6, 2025

@danielchalmers Hello, done

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…razor

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility Accessibility concerns (ARIA, keyboard, focus, screen readers, contrast) bug Unexpected behavior or functionality not working as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.