Skip to content

[material_ui] Port flutter/flutter #189345 "Fix todayBorder color being overridden by todayForegroundColor in YearPicker" - #12697

Open
Massinissa-Mouhoub wants to merge 1 commit into
flutter:mainfrom
Massinissa-Mouhoub:port-189345
Open

[material_ui] Port flutter/flutter #189345 "Fix todayBorder color being overridden by todayForegroundColor in YearPicker"#12697
Massinissa-Mouhoub wants to merge 1 commit into
flutter:mainfrom
Massinissa-Mouhoub:port-189345

Conversation

@Massinissa-Mouhoub

Copy link
Copy Markdown

This PR ports flutter/flutter#189345 from flutter/flutter to flutter/packages, as part of flutter/flutter#188444.

Fixes flutter/flutter#189298

YearPicker unconditionally overwrote DatePickerThemeData.todayBorder's color with the resolved todayForegroundColor, so a custom border color was ignored. The border color is now kept when it is set to a non-transparent color, and the existing fallback to todayForegroundColor is preserved for transparent borders.

@github-actions github-actions Bot added p: material_ui triage-design Should be looked at in design triage labels Aug 30, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request ensures that DatePickerThemeData.todayBorder is respected over todayForegroundColor in the year selector of the date picker. It updates the border color logic in _YearPickerState, updates the documentation, and adds corresponding regression tests. Feedback on the tests suggests correcting a test description that incorrectly references todayBackgroundColor instead of todayForegroundColor.

}

// Regression test for https://github.com/flutter/flutter/issues/189298
testWidgets('Non-null todayBorder color should be respected over todayBackgroundColor', (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The test description mentions todayBackgroundColor, but the test actually verifies that todayBorder is respected over todayForegroundColor. We should update the description to match the actual behavior being tested.

Suggested change
testWidgets('Non-null todayBorder color should be respected over todayBackgroundColor', (
testWidgets('Non-null todayBorder color should be respected over todayForegroundColor', (

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p: material_ui triage-design Should be looked at in design triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CalendarDatePicker: todayBorder color is still overridden by todayForegroundColor in year picker

1 participant