Skip to content

Commit 354296e

Browse files
- add styles for active adjacent day;
- scroll animation when adjacentDay is selected;
1 parent b67259e commit 354296e

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

core/src/components/datetime/datetime.ios.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@
251251
* is selected should have ion-color for
252252
* text color and be bolder.
253253
*/
254-
:host .calendar-day.calendar-day-active {
254+
:host .calendar-day.calendar-day-active,
255+
:host .calendar-day.calendar-day-adjacent-day.calendar-day-active {
255256
color: current-color(base);
256257

257258
font-weight: 600;

core/src/components/datetime/datetime.md.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@
117117
* is selected should have ion-color for
118118
* text color and be bolder.
119119
*/
120-
:host .calendar-day.calendar-day-active {
120+
:host .calendar-day.calendar-day-active,
121+
:host .calendar-day.calendar-day-adjacent-day.calendar-day-active{
121122
color: current-color(contrast);
122123
}
123124

core/src/components/datetime/datetime.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2380,11 +2380,6 @@ export class Datetime implements ComponentInterface {
23802380
return;
23812381
}
23822382

2383-
if (isAdjacentDay) {
2384-
// The user selected a day outside the current month. Ignore this button, as the month will be re-rendered.
2385-
this.el.blur();
2386-
}
2387-
23882383
this.setWorkingParts({
23892384
...this.workingParts,
23902385
month: _month,
@@ -2393,6 +2388,12 @@ export class Datetime implements ComponentInterface {
23932388
isAdjacentDay,
23942389
});
23952390

2391+
if (isAdjacentDay) {
2392+
// The user selected a day outside the current month. Ignore this button, as the month will be re-rendered.
2393+
this.el.blur();
2394+
this.animateToDate(this.workingParts);
2395+
}
2396+
23962397
// multiple only needs date info, so we can wipe out other fields like time
23972398
if (multiple) {
23982399
this.setActiveParts(

0 commit comments

Comments
 (0)