From 197f366866d3649e7a62ef7a88ff365885d2952e Mon Sep 17 00:00:00 2001 From: Davide Mininni Date: Tue, 12 Dec 2023 12:33:45 +0100 Subject: [PATCH] fix: rebase --- src/components/datepicker/datepicker/datepicker.ts | 2 +- src/components/datepicker/datepicker/readme.md | 2 +- src/components/time-input/readme.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/datepicker/datepicker/datepicker.ts b/src/components/datepicker/datepicker/datepicker.ts index 906f23036fe..b8008d6df6c 100644 --- a/src/components/datepicker/datepicker/datepicker.ts +++ b/src/components/datepicker/datepicker/datepicker.ts @@ -381,7 +381,7 @@ export class SbbDatepickerElement extends LitElement { protected override firstUpdated(_changedProperties: PropertyValues): void { super.firstUpdated(_changedProperties); - this._setAriaLiveMessage(this.getValueAsDate()); + this._setAriaLiveMessage(this.valueAsDate); } private _parseAndFormatValue(value: string): string { diff --git a/src/components/datepicker/datepicker/readme.md b/src/components/datepicker/datepicker/readme.md index 64254e97c72..5b61a04d9ca 100644 --- a/src/components/datepicker/datepicker/readme.md +++ b/src/components/datepicker/datepicker/readme.md @@ -52,7 +52,7 @@ Consumers can listen to the native `change` and `input` events on the `sbb-datep The `valueAsDate` property on the `sbb-datepicker` can be used to read the current value (e.g. from `event.target.valueAsDate`) or to set the value programmatically. -Each time the user changes the date by using the calendar, or the next and previous day arrow, or by using the `setValueAsDate()` method, +Each time the user changes the date by using the calendar, or the next and previous day arrow, or by using the `valueAsDate` setter, a `blur` event is fired on the input to ensure compatibility with any framework that relies on that event to update the current state. ## Custom date formats diff --git a/src/components/time-input/readme.md b/src/components/time-input/readme.md index d122b221fa4..f40051e6829 100644 --- a/src/components/time-input/readme.md +++ b/src/components/time-input/readme.md @@ -21,7 +21,7 @@ If the `sbb-time-input` is used within a `sbb-form-field` with a native input, t ``` -The initial value can be set using the `value` property (string) of the `input`or the `setValueAsDate()` method of the `sbb-time-input`. +The initial value can be set using the `value` property (string) of the `input`or the `valueAsDate` setter of the `sbb-time-input`. When the input changes, if it is valid, the component updates the `value` of the `input`.