Skip to content

Commit

Permalink
(Calendar) Fix internal state reset #27
Browse files Browse the repository at this point in the history
Don't reset to null, but to selection data.
  • Loading branch information
maxkeppeler committed Feb 19, 2023
1 parent e1d36c6 commit 9afa3d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,11 @@ internal class CalendarState(
}

override fun reset() {
date.value = null
date.value = selection.dateValue
dates.clear()
dates.addAll(selection.datesValue)
range.clear()
range.addAll(selection.rangeValue)
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,13 @@ internal fun CalendarBaseSelectionComponent(
onYearView: LazyListScope.() -> Unit
) {

val baseModifier = modifier
.sizeIn(
maxHeight = BaseConstants.DYNAMIC_SIZE_MAX,
maxWidth = BaseConstants.DYNAMIC_SIZE_MAX
)
.then(
val baseModifier = modifier.then(
when (orientation) {
LibOrientation.PORTRAIT -> Modifier.padding(top = dimensionResource(RC.dimen.scd_normal_100))
LibOrientation.LANDSCAPE -> Modifier
LibOrientation.LANDSCAPE -> Modifier.sizeIn(
maxHeight = BaseConstants.DYNAMIC_SIZE_MAX,
maxWidth = BaseConstants.DYNAMIC_SIZE_MAX
)
}
)

Expand Down

0 comments on commit 9afa3d6

Please sign in to comment.