From 5b9b54382cce9df559289a05b7ea4b49f14062f6 Mon Sep 17 00:00:00 2001 From: Ghislain B Date: Mon, 6 May 2024 22:06:47 -0400 Subject: [PATCH] fix: we shouldn't always commit on focusout/blur (#1192) - always committing as soon as we do focusout/blur is a little extreme since in some cases we for example clicking on an editor with a picker is closing the picker before we even a chance to choose anything --- .../src/custom-elements/aurelia-slickgrid.ts | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/packages/aurelia-slickgrid/src/custom-elements/aurelia-slickgrid.ts b/packages/aurelia-slickgrid/src/custom-elements/aurelia-slickgrid.ts index ec8e9f578..54f0906c5 100644 --- a/packages/aurelia-slickgrid/src/custom-elements/aurelia-slickgrid.ts +++ b/packages/aurelia-slickgrid/src/custom-elements/aurelia-slickgrid.ts @@ -71,13 +71,12 @@ import { SlickRowDetailView } from '../extensions/slickRowDetailView'; @customElement({ name: 'aurelia-slickgrid', - /* eslint-disable */ template: `
-
@@ -85,7 +84,6 @@ import { SlickRowDetailView } from '../extensions/slickRowDetailView';
` }) -/* eslint-enable */ export class AureliaSlickgridCustomElement { protected _columnDefinitions: Column[] = []; protected _currentDatasetLength = 0; @@ -589,28 +587,6 @@ export class AureliaSlickgridCustomElement { this.observeColumnDefinitions(); } - /** - * Commits the current edit to the grid - */ - commitEdit(target: Element) { - if (this.grid.getOptions().autoCommitEdit) { - const activeNode = this.grid.getActiveCellNode(); - - // a timeout must be set or this could come into conflict when slickgrid - // tries to commit the edit when going from one editor to another on the grid - // through the click event. If the timeout was not here it would - // try to commit/destroy the twice, which would throw an - // error about the element not being in the DOM - setTimeout(() => { - // make sure the target is the active editor so we do not - // commit prematurely - if (activeNode?.contains(target) && this.grid.getEditorLock().isActive() && !target?.classList?.contains('autocomplete')) { - this.grid.getEditorLock().commitCurrentEdit(); - } - }); - } - } - datasetChanged(newDataset: any[], oldValue: any[]) { const prevDatasetLn = this._currentDatasetLength; const isDatasetEqual = dequal(newDataset, this._dataset || []);