You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: If I build a material date picker with selectable range of today+1 day, whatever, then today day on the picker has no indication that it's not selectable. Here, Aug 19 is not selectable as per picker range, and disabledDayContentColor is red:
Expected behavior: Not clickable elements are visually disabled
Source code:
@Composable
internalfundayContentColor(
isToday:Boolean,
selected:Boolean,
inRange:Boolean,
enabled:Boolean
): State<Color> {
val target =when {
selected && enabled -> selectedDayContentColor
selected &&!enabled -> disabledSelectedDayContentColor
inRange && enabled -> dayInSelectionRangeContentColor
inRange &&!enabled -> disabledDayContentColor
isToday -> todayContentColor
enabled -> dayContentColor
else-> disabledDayContentColor
}
returnif (inRange) {
rememberUpdatedState(target)
} else {
// Animate the content color only when the day is not in a range.
animateColorAsState(target, tween(durationMillis =MotionTokens.DurationShort2.toInt()))
}
}
In the source the first two clauses are false because today is not selected, following two are also false because it's not in selectable range either. But isToday is true so the picked color is todayContentColor even though the day is also not enabled.
Minimal sample app repro: trivially reproducible
Android API version: Api 34
Material Library version: Compose dev.chrisbanes.compose:compose-bom:2024.08.00-alpha01
Device: emulator
To help us triage faster, please check to make sure you are using the latest version of the library.
Seems like you opened the issue in the wrong repository. This repository is for Material Components for Views and not for Compose. The Compose code is contained at androidx. Please refer to the docs there for submitting your issue.
Description: If I build a material date picker with selectable range of
today+1 day, whatever
, then today day on the picker has no indication that it's not selectable. Here, Aug 19 is not selectable as per picker range, anddisabledDayContentColor
is red:Expected behavior: Not clickable elements are visually disabled
Source code:
In the source the first two clauses are false because today is not
selected
, following two are also false because it's not in selectable range either. ButisToday
is true so the picked color istodayContentColor
even though the day is also not enabled.Minimal sample app repro: trivially reproducible
Android API version: Api 34
Material Library version: Compose
dev.chrisbanes.compose:compose-bom:2024.08.00-alpha01
Device: emulator
To help us triage faster, please check to make sure you are using the latest version of the library.
We also happily accept pull requests.
The text was updated successfully, but these errors were encountered: