@dereekb/dbx-form 13.10.8 → 13.10.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6051,7 +6051,12 @@ class DbxForgeDateTimeFieldComponent {
6051
6051
  return;
6052
6052
  const currentDateCtrl = this.dateCtrl.value;
6053
6053
  if (!currentDateCtrl || !isSameDateDay(currentDateCtrl, date)) {
6054
- this.dateCtrl.setValue(date, { emitEvent: false });
6054
+ // Emit valueChanges (default) so currentDate$ and therefore date$/dateValue$/_rawDateTimeDate$
6055
+ // — see the inbound date. Without this emission, rawDateTime$.combineLatest is starved on the
6056
+ // date side and a user-typed time edit can never propagate back to the form value.
6057
+ // The outbound pipeline's `filter(!dbxDateTimeIsSameDateTimeFieldValue(x, currentValue))`
6058
+ // prevents the resulting _updateTime tick from causing a feedback write.
6059
+ this.dateCtrl.setValue(date);
6055
6060
  }
6056
6061
  // Do not overwrite time control while user is actively editing it
6057
6062
  if (!isTimeFocused) {
@@ -6061,10 +6066,14 @@ class DbxForgeDateTimeFieldComponent {
6061
6066
  }
6062
6067
  }
6063
6068
  });
6064
- // Main output subscription: timeOutput$ → field value
6065
- this._sub.subscription = this.valueInSystemTimezone$
6066
- .pipe(combineLatestWith$1(this.timezoneInstance$.pipe(map$1((tz) => dbxDateTimeOutputValueFactory(this.valueMode(), tz)))), throttleTime$1(TIME_OUTPUT_THROTTLE_TIME$2, undefined, { leading: false, trailing: true }), switchMap$1(([currentValue, valueFactory]) => {
6067
- return this.timeOutput$.pipe(throttleTime$1(TIME_OUTPUT_THROTTLE_TIME$2 * 2, undefined, { leading: false, trailing: true }), skipAllInitialMaybe(), distinctUntilChanged$1(isSameDateHoursAndMinutes), map$1((x) => valueFactory(x)), filter$1((x) => !dbxDateTimeIsSameDateTimeFieldValue(x, currentValue)));
6069
+ // Main output subscription: timeOutput$ → field value.
6070
+ // The filter must compare in storage form against the raw fieldValue. Comparing against
6071
+ // valueInSystemTimezone$ (display-shifted) is wrong: with a non-zero system↔target tz shift,
6072
+ // a freshly picked time can have the same timestamp as the previous valueInSystemTimezone$
6073
+ // and be incorrectly dropped (e.g. CDT system + UTC field tz: pick 12pm → pick 5pm collides).
6074
+ this._sub.subscription = this.fieldValue$
6075
+ .pipe(combineLatestWith$1(this.timezoneInstance$.pipe(map$1((tz) => dbxDateTimeOutputValueFactory(this.valueMode(), tz)))), throttleTime$1(TIME_OUTPUT_THROTTLE_TIME$2, undefined, { leading: false, trailing: true }), switchMap$1(([currentRawValue, valueFactory]) => {
6076
+ return this.timeOutput$.pipe(throttleTime$1(TIME_OUTPUT_THROTTLE_TIME$2 * 2, undefined, { leading: false, trailing: true }), skipAllInitialMaybe(), distinctUntilChanged$1(isSameDateHoursAndMinutes), map$1((x) => valueFactory(x)), filter$1((x) => !dbxDateTimeIsSameDateTimeFieldValue(x, currentRawValue)));
6068
6077
  }))
6069
6078
  .subscribe((value) => {
6070
6079
  this._setFieldValue(value);