Skip to content

Conversation

@spingee
Copy link

@spingee spingee commented Nov 1, 2025

Also, input now retains focus when popup is clicked

@spingee spingee changed the title Ability to navigate datepicker with keys DatePicker: Ability to navigate datepicker with keys Nov 1, 2025
@mudbot mudbot bot added accessibility Accessibility concerns (ARIA, keyboard, focus, screen readers, contrast) enhancement Request for adding a new feature or enhancing existing functionality (not fixing a defect) labels Nov 1, 2025
gemini-code-assist[bot]

This comment was marked as spam.

@spingee spingee force-pushed the feature/datepicker_key_nav branch from d14ba74 to 88ec782 Compare November 1, 2025 14:21
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 enhances keyboard navigation in the MudDatePicker component by implementing arrow key navigation across different picker views (Date, Month, Year) and enabling Enter key selection. The changes also include focus management improvements and mouse event handling adjustments.

  • Implemented arrow key navigation (left/right/up/down) for navigating dates, months, and years
  • Enhanced Enter key handling to select the currently highlighted date/month/year based on the current view
  • Added FocusAsync() calls when clicking on dates, months, and years for better accessibility
  • Modified event handlers to prevent default mouse behavior on certain picker elements

Reviewed Changes

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

File Description
MudDatePicker.cs Core logic for keyboard navigation: arrow key handlers for navigating dates/months/years, Enter key selection for highlighted items, and FocusAsync calls in click handlers
MudBaseDatePicker.razor.cs Changed visibility of helper methods/fields from private to protected, updated ScrollToYear to accept optional date parameter, trailing whitespace cleanup
MudBaseDatePicker.razor Added mousedown preventDefault attributes to toolbar and calendar content, cleaned up lambda expressions
DatePickerTests.cs Added comprehensive test for keyboard navigation and date selection workflow

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

@spingee spingee force-pushed the feature/datepicker_key_nav branch from 88ec782 to d696c07 Compare November 2, 2025 13:48
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) enhancement Request for adding a new feature or enhancing existing functionality (not fixing a defect)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant