Skip to content

Comments

Fix: Invisible selected date#23

Merged
ngocvuphan merged 1 commit intongocvuphan:mainfrom
AbRa734:fix/invisible-selected-day
Feb 24, 2026
Merged

Fix: Invisible selected date#23
ngocvuphan merged 1 commit intongocvuphan:mainfrom
AbRa734:fix/invisible-selected-day

Conversation

@AbRa734
Copy link

@AbRa734 AbRa734 commented Feb 23, 2026

Problem: When an initialDate is provided that falls outside the allowed range (e.g., it is disabled), the calendar assigns a white text color (onPrimary) to the selected day, but sets the background color to null because of the isEnabled && isSelected condition in BoxDecoration. This makes the text invisible on light themes.

Solution: Changed the background color logic to color: isSelected ? color : null. The color variable is already properly calculated a few lines above to have a lower opacity (.withAlpha(128)) if the date is disabled. This change allows the disabled-but-selected date to show a greyed-out primary background, making the white text readable and indicating what the current initial value is without allowing the user to select other disabled dates.

@ngocvuphan ngocvuphan merged commit 46da0a2 into ngocvuphan:main Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants