Skip to content

Commit

Permalink
fix(datetime): update active day styling when day is selected
Browse files Browse the repository at this point in the history
Resolves #24414
  • Loading branch information
sean-perkins committed Dec 21, 2021
1 parent 4715b83 commit 541c047
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions core/src/components/datetime/datetime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -802,14 +802,14 @@ export class Datetime implements ComponentInterface {
startIO = new IntersectionObserver(ev => ioCallback('start', ev), {
threshold: mode === 'ios' ? [0.7, 1] : 1,
root: calendarBodyRef
});
});
startIO.observe(startMonth);

this.destroyCalendarIO = () => {
endIO?.disconnect();
startIO?.disconnect();
}
});
});
}

connectedCallback() {
Expand Down Expand Up @@ -1201,12 +1201,12 @@ export class Datetime implements ComponentInterface {
year
});

this.setActiveParts({
this.setActiveParts(this.activePartsClone = {
...this.activeParts,
month,
day,
year
})
});
}}
>{day}</button>
)
Expand Down Expand Up @@ -1249,7 +1249,7 @@ export class Datetime implements ComponentInterface {
minutesItems: PickerColumnItem[],
ampmItems: PickerColumnItem[],
use24Hour: boolean
) {
) {
const { color, activePartsClone, workingParts } = this;

return (
Expand Down Expand Up @@ -1290,7 +1290,7 @@ export class Datetime implements ComponentInterface {
ev.stopPropagation();
}}
></ion-picker-column-internal>
{ !use24Hour && <ion-picker-column-internal
{!use24Hour && <ion-picker-column-internal
color={color}
value={activePartsClone.ampm}
items={ampmItems}
Expand All @@ -1311,7 +1311,7 @@ export class Datetime implements ComponentInterface {

ev.stopPropagation();
}}
></ion-picker-column-internal> }
></ion-picker-column-internal>}
</ion-picker-internal>
)
}
Expand All @@ -1321,7 +1321,7 @@ export class Datetime implements ComponentInterface {
minutesItems: PickerColumnItem[],
ampmItems: PickerColumnItem[],
use24Hour: boolean
) {
) {
return [
<div class="time-header">
{this.renderTimeLabel()}
Expand Down Expand Up @@ -1411,7 +1411,7 @@ export class Datetime implements ComponentInterface {

return (
<div class="datetime-time">
{timeOnlyPresentation ? this.renderTimePicker(hoursItems, minutesItems, ampmItems, use24Hour) : this.renderTimeOverlay(hoursItems, minutesItems, ampmItems, use24Hour)}
{timeOnlyPresentation ? this.renderTimePicker(hoursItems, minutesItems, ampmItems, use24Hour) : this.renderTimeOverlay(hoursItems, minutesItems, ampmItems, use24Hour)}
</div>
)
}
Expand Down

0 comments on commit 541c047

Please sign in to comment.