@sumaris-net/ngx-components 21.4.5 → 21.4.6

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.
package/doc/changelog.md CHANGED
@@ -2523,3 +2523,6 @@ The library now uses the Ionic **standalone** build (`@ionic/angular/standalone`
2523
2523
  * Fix `cancelExistingRow()` (inverted `interactive` logic: never asked for confirmation, and looped when `onBeforeCancelRows` was observed)
2524
2524
  * Add `confirmAndUp()`, options `keepSelection`, `confirmRow` and `throwIfNotConfirmed` in `save()`, `logPrefix`, `reservedStartColumns` and `reservedEndColumns`
2525
2525
  * `save({ keepEditing: true })` now also restores the first row (id = 0); `confirmAndForward()` and `confirmAndAdd()` no longer fail without any row
2526
+
2527
+ ## 21.4.6
2528
+ - fix(table): `AppTable`: fix a reload while a new row is in edition: the last row was deleted, in addition to the new row (and then lost on save)
@@ -43278,7 +43278,8 @@ class AppTable {
43278
43278
  }
43279
43279
  if (this.dirty || (this.editedRow && this.editedRow.id !== this.previouslyEditedRowId)) {
43280
43280
  // Cancel the current editing row only if editing and if it was not previously saved
43281
- if (this.editedRow?.editing) {
43281
+ // Skip a row that is not in the data source anymore (e.g. after a reload): deleting the row -1 would delete the last row instead
43282
+ if (this.editedRow?.editing && this.dataSource.getRows().includes(this.editedRow)) {
43282
43283
  // Cancel the current editing row only if editing and if it was not previously saved
43283
43284
  if (this.editedRow.id === -1) {
43284
43285
  this.dataSource.delete(-1);