Skip to content

Commit

Permalink
fix(datetime): update active calendar display when value changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-perkins committed Nov 18, 2021
1 parent 3c4f9fd commit 232d60f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/src/components/datetime/datetime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ export class Datetime implements ComponentInterface {
*/
@Watch('value')
protected valueChanged() {
if (this.hasValue()) {
this.processValue(this.value);
}
this.emitStyle();
this.ionChange.emit({
value: this.value
Expand Down Expand Up @@ -951,6 +954,10 @@ export class Datetime implements ComponentInterface {
this.ionBlur.emit();
}

private hasValue = () => {
return this.value != null && this.value !== ''
}

private nextMonth = () => {
const { calendarBodyRef } = this;
if (!calendarBodyRef) { return; }
Expand Down

0 comments on commit 232d60f

Please sign in to comment.