From 3abaf85353d40e36e9a498cb5686b7533f95535a Mon Sep 17 00:00:00 2001 From: ugur-vaadin Date: Tue, 19 Mar 2024 01:08:13 +0200 Subject: [PATCH 01/20] fix: defer focus in order to have editor ready before --- .../src/vaadin-grid-pro-edit-column-mixin.js | 6 ++++-- .../grid-pro/test/edit-column-renderer.common.js | 10 ++++++---- packages/grid-pro/test/edit-column-type.common.js | 14 +++++++++++++- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js b/packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js index 422fa26a45..a943c0f842 100644 --- a/packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js +++ b/packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js @@ -267,8 +267,10 @@ export const GridProEditColumnMixin = (superClass) => this._setEditorValue(editor, get(this.path, model.item)); editor._grid = this._grid; - this._focusEditor(editor); - requestAnimationFrame(() => this._focusEditor(editor)); + queueMicrotask(() => { + this._focusEditor(editor); + queueMicrotask(() => editor.focus()); + }); } /** diff --git a/packages/grid-pro/test/edit-column-renderer.common.js b/packages/grid-pro/test/edit-column-renderer.common.js index 7712312baa..cccfc3579e 100644 --- a/packages/grid-pro/test/edit-column-renderer.common.js +++ b/packages/grid-pro/test/edit-column-renderer.common.js @@ -169,7 +169,7 @@ describe('edit column renderer', () => { expect(editor.value).to.be.equal(grid.items[0].name); }); - it('should call `focus()` on the custom editor component after entering the cell edit mode', () => { + it('should call `focus()` on the custom editor component after entering the cell edit mode', async () => { let spy; column.editModeRenderer = function (root) { @@ -180,10 +180,11 @@ describe('edit column renderer', () => { }; dblclick(cell._content); - expect(spy.calledOnce).to.be.true; + await nextFrame(); + expect(spy.called).to.be.true; }); - it('should call `select()` on the custom editor component, if the was rendered', () => { + it('should call `select()` on the custom editor component, if the was rendered', async () => { let spy; column.editModeRenderer = function (root) { @@ -194,7 +195,8 @@ describe('edit column renderer', () => { }; dblclick(cell._content); - expect(spy.calledOnce).to.be.true; + await nextFrame(); + expect(spy.called).to.be.true; }); it('should exit the edit mode on custom editor component focusout event', () => { diff --git a/packages/grid-pro/test/edit-column-type.common.js b/packages/grid-pro/test/edit-column-type.common.js index 22f7395210..61a88a5159 100644 --- a/packages/grid-pro/test/edit-column-type.common.js +++ b/packages/grid-pro/test/edit-column-type.common.js @@ -11,6 +11,7 @@ import { nextRender, space, } from '@vaadin/testing-helpers'; +import { sendKeys } from '@web/test-runner-commands'; import sinon from 'sinon'; import { createItems, dblclick, flushGrid, getCellEditor, getContainerCell, onceOpened } from './helpers.js'; @@ -97,8 +98,9 @@ describe('edit column editor type', () => { expect(checkbox.checked).to.be.equal(grid.items[0].married); }); - it('should set focus-ring on the checkbox', () => { + it('should set focus-ring on the checkbox', async () => { dblclick(cell._content); + await nextFrame(); checkbox = column._getEditorComponent(cell); expect(checkbox.hasAttribute('focus-ring')).to.be.true; }); @@ -362,5 +364,15 @@ describe('edit column editor type', () => { editor = column._getEditorComponent(cell); expect(editor).to.be.not.ok; }); + + it('should not start edit with first character selected', async () => { + column = grid.querySelector('[path="name"]'); + cell = getContainerCell(grid.$.items, 0, columns.indexOf(column)); + cell.focus(); + await sendKeys({ down: 'a' }); + await sendKeys({ down: 'b' }); + editor = column._getEditorComponent(cell); + expect(editor.value).to.be.equal('ab'); + }); }); }); From cfb78877cf58a0b33f6ada4805897e6a8b6f93af Mon Sep 17 00:00:00 2001 From: ugur-vaadin Date: Tue, 19 Mar 2024 01:15:49 +0200 Subject: [PATCH 02/20] test: fix unit test for firefox --- packages/grid-pro/test/edit-column-type.common.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/grid-pro/test/edit-column-type.common.js b/packages/grid-pro/test/edit-column-type.common.js index 61a88a5159..2ba9574640 100644 --- a/packages/grid-pro/test/edit-column-type.common.js +++ b/packages/grid-pro/test/edit-column-type.common.js @@ -371,8 +371,8 @@ describe('edit column editor type', () => { cell.focus(); await sendKeys({ down: 'a' }); await sendKeys({ down: 'b' }); - editor = column._getEditorComponent(cell); - expect(editor.value).to.be.equal('ab'); + await sendKeys({ down: 'Enter' }); + expect(cell._content.textContent).to.equal('ab'); }); }); }); From b128cc2a1761fc0b79bcc26e78d458d0ca75221a Mon Sep 17 00:00:00 2001 From: ugur-vaadin Date: Tue, 19 Mar 2024 01:29:11 +0200 Subject: [PATCH 03/20] test: await next render before assertion --- packages/grid-pro/test/edit-column-type.common.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/grid-pro/test/edit-column-type.common.js b/packages/grid-pro/test/edit-column-type.common.js index 2ba9574640..15c3b38400 100644 --- a/packages/grid-pro/test/edit-column-type.common.js +++ b/packages/grid-pro/test/edit-column-type.common.js @@ -372,6 +372,7 @@ describe('edit column editor type', () => { await sendKeys({ down: 'a' }); await sendKeys({ down: 'b' }); await sendKeys({ down: 'Enter' }); + await nextRender(); expect(cell._content.textContent).to.equal('ab'); }); }); From fe49083b4f8caf3f80c0000cfa8d9c7cbcec4ac1 Mon Sep 17 00:00:00 2001 From: ugur-vaadin Date: Tue, 19 Mar 2024 01:33:27 +0200 Subject: [PATCH 04/20] test: add another await next render after the first keydown --- packages/grid-pro/test/edit-column-type.common.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/grid-pro/test/edit-column-type.common.js b/packages/grid-pro/test/edit-column-type.common.js index 15c3b38400..47a8a791e7 100644 --- a/packages/grid-pro/test/edit-column-type.common.js +++ b/packages/grid-pro/test/edit-column-type.common.js @@ -370,6 +370,7 @@ describe('edit column editor type', () => { cell = getContainerCell(grid.$.items, 0, columns.indexOf(column)); cell.focus(); await sendKeys({ down: 'a' }); + await nextRender(); await sendKeys({ down: 'b' }); await sendKeys({ down: 'Enter' }); await nextRender(); From 727a168823c4041fdf509bef80a3501f0cc9a839 Mon Sep 17 00:00:00 2001 From: ugur-vaadin Date: Tue, 19 Mar 2024 01:37:02 +0200 Subject: [PATCH 05/20] Revert "test: add another await next render after the first keydown" This reverts commit 3a62f57be6814ddbe03c2d446af1e1f8505c7a8d. --- packages/grid-pro/test/edit-column-type.common.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/grid-pro/test/edit-column-type.common.js b/packages/grid-pro/test/edit-column-type.common.js index 47a8a791e7..15c3b38400 100644 --- a/packages/grid-pro/test/edit-column-type.common.js +++ b/packages/grid-pro/test/edit-column-type.common.js @@ -370,7 +370,6 @@ describe('edit column editor type', () => { cell = getContainerCell(grid.$.items, 0, columns.indexOf(column)); cell.focus(); await sendKeys({ down: 'a' }); - await nextRender(); await sendKeys({ down: 'b' }); await sendKeys({ down: 'Enter' }); await nextRender(); From 83081e59a26455fc4eecffc449ee407ce1beeee7 Mon Sep 17 00:00:00 2001 From: ugur-vaadin Date: Tue, 19 Mar 2024 01:37:24 +0200 Subject: [PATCH 06/20] Revert "test: await next render before assertion" This reverts commit d5939d126ed31b5d7ec996bee34c547ec6bf28d5. --- packages/grid-pro/test/edit-column-type.common.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/grid-pro/test/edit-column-type.common.js b/packages/grid-pro/test/edit-column-type.common.js index 15c3b38400..2ba9574640 100644 --- a/packages/grid-pro/test/edit-column-type.common.js +++ b/packages/grid-pro/test/edit-column-type.common.js @@ -372,7 +372,6 @@ describe('edit column editor type', () => { await sendKeys({ down: 'a' }); await sendKeys({ down: 'b' }); await sendKeys({ down: 'Enter' }); - await nextRender(); expect(cell._content.textContent).to.equal('ab'); }); }); From f180f2bd99217696287a46de8c362129a3d8396e Mon Sep 17 00:00:00 2001 From: ugur-vaadin Date: Tue, 19 Mar 2024 02:21:47 +0200 Subject: [PATCH 07/20] test: update material visual test reference image --- .../grid-pro/baseline/edit-column-select.png | Bin 3849 -> 3849 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/packages/grid-pro/test/visual/material/screenshots/grid-pro/baseline/edit-column-select.png b/packages/grid-pro/test/visual/material/screenshots/grid-pro/baseline/edit-column-select.png index 7310a01ebfed3d1557dc37f3c3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aez%7z@PSqwV>0fkbr$0C7Zsd1EMEQ3S%h`}cbu+B+zuqsBDvV$ZOo z>O2vaI4^i@rHzsbCwW&(WtvL?jp2IunMoS>TlD*Ipg=Do$+x!Mx3&OC9@2P5@VV!p zv;!d3GU*C^Ko{jBKJ_T%2YVoKkme~zD(5y*m`&iEw$B5fG-0I7rR-DoB^TA7EM;C- z0I|f3C!8nQ05e7*H`gY|r0pkn-C zIQJ)5RT{;M*}YIXr1$xZ@~_~O@rWpuZor^F(QhafLVSYVtBrTQsQ!p3@7zP3rASl- zJk3%Ar+E{F7p9)JR4O^W)_L^JfL^sTG`Me5QPM~q#7Qv{_;C+UiK74)pUa45R$0&l zTrWEpcPK6Jv9dA(og&yd)(!orD0F8+GNB){(L6Un1tS#e5KO|NnMR>~IhG!8I4CgU zOOBAKrFWO3BMa7y4mB?N3qG0vc^ODDGl?_D7^@VGBlm|pl(FsF2^0)8>vWXTQ^BH6 z{WK8{D;B%ocNCOR*r(ze47$PYt#jn=ZvnfAGj%&DtWLX7uDz)MrWdAA#pK0_b$_>3 z9q`@n4w-pS_K)<=)5wVBHVo%!@scs^*ao^y@E{9AEtNa?TMT-N$NUb*boxT%=#W)K z9-ziVHpAp>B5q~fH7G=|z(5>NQhBw$Ps@4!QkCBuK}MCmMT0IT~`eD?Qu8aH!l-?Aci~er;D) z`E6p`Tmb2ps4h%3TBRihePev&YxU!}?fk2EvNOuw^8NeSbIfX?`s^*Fv)&5?0 Date: Fri, 22 Mar 2024 08:53:40 +0200 Subject: [PATCH 08/20] fix: set edit initiator char explicitly --- .../grid-pro/src/vaadin-grid-pro-edit-column-mixin.js | 11 +++++++++-- .../src/vaadin-grid-pro-inline-editing-mixin.js | 4 ++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js b/packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js index a943c0f842..36d9912ff8 100644 --- a/packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js +++ b/packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js @@ -86,6 +86,9 @@ export const GridProEditColumnMixin = (superClass) => /** @private */ _oldRenderer: Function, + + /** @private */ + _editInitiatorChar: String, }; } @@ -267,9 +270,13 @@ export const GridProEditColumnMixin = (superClass) => this._setEditorValue(editor, get(this.path, model.item)); editor._grid = this._grid; - queueMicrotask(() => { + const editInitiatorChar = this._editInitiatorChar; + this._editInitiatorChar = undefined; + requestAnimationFrame(() => { this._focusEditor(editor); - queueMicrotask(() => editor.focus()); + if (editInitiatorChar) { + this._setEditorValue(editor, editInitiatorChar); + } }); } diff --git a/packages/grid-pro/src/vaadin-grid-pro-inline-editing-mixin.js b/packages/grid-pro/src/vaadin-grid-pro-inline-editing-mixin.js index 53edc48be4..cec814dd7b 100644 --- a/packages/grid-pro/src/vaadin-grid-pro-inline-editing-mixin.js +++ b/packages/grid-pro/src/vaadin-grid-pro-inline-editing-mixin.js @@ -290,6 +290,10 @@ export const InlineEditingMixin = (superClass) => this._flushStopEdit(); + if (type === 'text') { + column._editInitiatorChar = e.key; + } + this._startEdit(cell, column); } else if (edited) { this._stopEdit(); From 80b35d799c689185bb00f2231b014f02c6319d9c Mon Sep 17 00:00:00 2001 From: ugur-vaadin Date: Fri, 22 Mar 2024 09:06:51 +0200 Subject: [PATCH 09/20] test: revert skip test --- packages/grid-pro/test/keyboard-navigation.common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/grid-pro/test/keyboard-navigation.common.js b/packages/grid-pro/test/keyboard-navigation.common.js index 7fc7400e84..a45ad9f793 100644 --- a/packages/grid-pro/test/keyboard-navigation.common.js +++ b/packages/grid-pro/test/keyboard-navigation.common.js @@ -113,7 +113,7 @@ describe('keyboard navigation', () => { expect(getCellEditor(firstCell)).to.be.not.ok; }); - it.skip('should focus correct editable cell after column reordering', () => { + it('should focus correct editable cell after column reordering', () => { grid.columnReorderingAllowed = true; const headerContent = [ getContainerCell(grid.$.header, 0, 0)._content, From 0df8bde7132c2d66b26b7a9488d07be1b07034c8 Mon Sep 17 00:00:00 2001 From: ugur-vaadin Date: Fri, 22 Mar 2024 09:30:47 +0200 Subject: [PATCH 10/20] fix: do not select input when initialized with character --- packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js b/packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js index 36d9912ff8..471f360196 100644 --- a/packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js +++ b/packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js @@ -273,9 +273,11 @@ export const GridProEditColumnMixin = (superClass) => const editInitiatorChar = this._editInitiatorChar; this._editInitiatorChar = undefined; requestAnimationFrame(() => { - this._focusEditor(editor); if (editInitiatorChar) { this._setEditorValue(editor, editInitiatorChar); + editor.focus(); + } else { + this._focusEditor(editor); } }); } From 1c27e3be346b21bb41276cccd5ced4583a6dc725 Mon Sep 17 00:00:00 2001 From: Ugur Saglam <106508695+ugur-vaadin@users.noreply.github.com> Date: Fri, 22 Mar 2024 10:17:48 +0200 Subject: [PATCH 11/20] Update packages/grid-pro/test/edit-column-type.common.js Co-authored-by: Sergey Vinogradov --- packages/grid-pro/test/edit-column-type.common.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/grid-pro/test/edit-column-type.common.js b/packages/grid-pro/test/edit-column-type.common.js index 2ba9574640..f0281b6486 100644 --- a/packages/grid-pro/test/edit-column-type.common.js +++ b/packages/grid-pro/test/edit-column-type.common.js @@ -370,6 +370,7 @@ describe('edit column editor type', () => { cell = getContainerCell(grid.$.items, 0, columns.indexOf(column)); cell.focus(); await sendKeys({ down: 'a' }); + await nextFrame(); await sendKeys({ down: 'b' }); await sendKeys({ down: 'Enter' }); expect(cell._content.textContent).to.equal('ab'); From 558ae393bab06b2d84320131dd942027beada639 Mon Sep 17 00:00:00 2001 From: ugur-vaadin Date: Tue, 26 Mar 2024 11:48:02 +0200 Subject: [PATCH 12/20] refactor: extract input selection logic from editor focus --- .../grid-pro/src/vaadin-grid-pro-edit-column-mixin.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js b/packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js index 471f360196..586210c849 100644 --- a/packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js +++ b/packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js @@ -185,7 +185,12 @@ export const GridProEditColumnMixin = (superClass) => editor.focus(); if (this.editorType === 'checkbox') { editor.setAttribute('focus-ring', ''); - } else if (editor instanceof HTMLInputElement) { + } + } + + /** @private */ + _selectEditorInput(editor) { + if (editor instanceof HTMLInputElement) { editor.select(); } else if (editor.focusElement && editor.focusElement instanceof HTMLInputElement) { editor.focusElement.select(); @@ -275,9 +280,10 @@ export const GridProEditColumnMixin = (superClass) => requestAnimationFrame(() => { if (editInitiatorChar) { this._setEditorValue(editor, editInitiatorChar); - editor.focus(); + this._focusEditor(editor); } else { this._focusEditor(editor); + this._selectEditorInput(editor); } }); } From 774cb53ffb7ca57892b6c2a3790a58962c0a0fde Mon Sep 17 00:00:00 2001 From: ugur-vaadin Date: Tue, 26 Mar 2024 11:59:57 +0200 Subject: [PATCH 13/20] refactor: change name of the new property --- .../grid-pro/src/vaadin-grid-pro-edit-column-mixin.js | 10 +++++----- .../src/vaadin-grid-pro-inline-editing-mixin.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js b/packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js index 586210c849..124277a955 100644 --- a/packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js +++ b/packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js @@ -88,7 +88,7 @@ export const GridProEditColumnMixin = (superClass) => _oldRenderer: Function, /** @private */ - _editInitiatorChar: String, + _editInitiatorKey: String, }; } @@ -275,11 +275,11 @@ export const GridProEditColumnMixin = (superClass) => this._setEditorValue(editor, get(this.path, model.item)); editor._grid = this._grid; - const editInitiatorChar = this._editInitiatorChar; - this._editInitiatorChar = undefined; + const editInitiatorKey = this._editInitiatorKey; + this._editInitiatorKey = undefined; requestAnimationFrame(() => { - if (editInitiatorChar) { - this._setEditorValue(editor, editInitiatorChar); + if (editInitiatorKey) { + this._setEditorValue(editor, editInitiatorKey); this._focusEditor(editor); } else { this._focusEditor(editor); diff --git a/packages/grid-pro/src/vaadin-grid-pro-inline-editing-mixin.js b/packages/grid-pro/src/vaadin-grid-pro-inline-editing-mixin.js index cec814dd7b..b9457a5308 100644 --- a/packages/grid-pro/src/vaadin-grid-pro-inline-editing-mixin.js +++ b/packages/grid-pro/src/vaadin-grid-pro-inline-editing-mixin.js @@ -291,7 +291,7 @@ export const InlineEditingMixin = (superClass) => this._flushStopEdit(); if (type === 'text') { - column._editInitiatorChar = e.key; + column._editInitiatorKey = e.key; } this._startEdit(cell, column); From 750fe4e51e6e399b2963d3ac23dfb732b0929055 Mon Sep 17 00:00:00 2001 From: ugur-vaadin Date: Wed, 27 Mar 2024 22:16:47 +0200 Subject: [PATCH 14/20] refactor: focus lit editor once it is ready --- .../src/vaadin-grid-pro-edit-column-mixin.js | 26 +++++-------------- .../vaadin-grid-pro-inline-editing-mixin.js | 4 --- 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js b/packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js index 124277a955..1819b38ae8 100644 --- a/packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js +++ b/packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js @@ -86,9 +86,6 @@ export const GridProEditColumnMixin = (superClass) => /** @private */ _oldRenderer: Function, - - /** @private */ - _editInitiatorKey: String, }; } @@ -185,12 +182,7 @@ export const GridProEditColumnMixin = (superClass) => editor.focus(); if (this.editorType === 'checkbox') { editor.setAttribute('focus-ring', ''); - } - } - - /** @private */ - _selectEditorInput(editor) { - if (editor instanceof HTMLInputElement) { + } else if (editor instanceof HTMLInputElement) { editor.select(); } else if (editor.focusElement && editor.focusElement instanceof HTMLInputElement) { editor.focusElement.select(); @@ -275,17 +267,11 @@ export const GridProEditColumnMixin = (superClass) => this._setEditorValue(editor, get(this.path, model.item)); editor._grid = this._grid; - const editInitiatorKey = this._editInitiatorKey; - this._editInitiatorKey = undefined; - requestAnimationFrame(() => { - if (editInitiatorKey) { - this._setEditorValue(editor, editInitiatorKey); - this._focusEditor(editor); - } else { - this._focusEditor(editor); - this._selectEditorInput(editor); - } - }); + if (editor.updateComplete) { + editor.updateComplete.then(() => this._focusEditor(editor)); + } else { + this._focusEditor(editor); + } } /** diff --git a/packages/grid-pro/src/vaadin-grid-pro-inline-editing-mixin.js b/packages/grid-pro/src/vaadin-grid-pro-inline-editing-mixin.js index b9457a5308..53edc48be4 100644 --- a/packages/grid-pro/src/vaadin-grid-pro-inline-editing-mixin.js +++ b/packages/grid-pro/src/vaadin-grid-pro-inline-editing-mixin.js @@ -290,10 +290,6 @@ export const InlineEditingMixin = (superClass) => this._flushStopEdit(); - if (type === 'text') { - column._editInitiatorKey = e.key; - } - this._startEdit(cell, column); } else if (edited) { this._stopEdit(); From bde29e2250c829f11817cf9c4d1cdf589881b717 Mon Sep 17 00:00:00 2001 From: ugur-vaadin Date: Wed, 27 Mar 2024 22:22:06 +0200 Subject: [PATCH 15/20] test: revert unnecessary awaits --- packages/grid-pro/test/edit-column-renderer.common.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/grid-pro/test/edit-column-renderer.common.js b/packages/grid-pro/test/edit-column-renderer.common.js index cccfc3579e..5733a9f151 100644 --- a/packages/grid-pro/test/edit-column-renderer.common.js +++ b/packages/grid-pro/test/edit-column-renderer.common.js @@ -169,7 +169,7 @@ describe('edit column renderer', () => { expect(editor.value).to.be.equal(grid.items[0].name); }); - it('should call `focus()` on the custom editor component after entering the cell edit mode', async () => { + it('should call `focus()` on the custom editor component after entering the cell edit mode', () => { let spy; column.editModeRenderer = function (root) { @@ -180,11 +180,10 @@ describe('edit column renderer', () => { }; dblclick(cell._content); - await nextFrame(); expect(spy.called).to.be.true; }); - it('should call `select()` on the custom editor component, if the was rendered', async () => { + it('should call `select()` on the custom editor component, if the was rendered', () => { let spy; column.editModeRenderer = function (root) { @@ -195,7 +194,6 @@ describe('edit column renderer', () => { }; dblclick(cell._content); - await nextFrame(); expect(spy.called).to.be.true; }); From d82353d606c256cd935c13bac2f05cb512221fb7 Mon Sep 17 00:00:00 2001 From: ugur-vaadin Date: Wed, 27 Mar 2024 22:23:40 +0200 Subject: [PATCH 16/20] test: revery unnecessary test assertion changes --- packages/grid-pro/test/edit-column-renderer.common.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/grid-pro/test/edit-column-renderer.common.js b/packages/grid-pro/test/edit-column-renderer.common.js index 5733a9f151..7712312baa 100644 --- a/packages/grid-pro/test/edit-column-renderer.common.js +++ b/packages/grid-pro/test/edit-column-renderer.common.js @@ -180,7 +180,7 @@ describe('edit column renderer', () => { }; dblclick(cell._content); - expect(spy.called).to.be.true; + expect(spy.calledOnce).to.be.true; }); it('should call `select()` on the custom editor component, if the was rendered', () => { @@ -194,7 +194,7 @@ describe('edit column renderer', () => { }; dblclick(cell._content); - expect(spy.called).to.be.true; + expect(spy.calledOnce).to.be.true; }); it('should exit the edit mode on custom editor component focusout event', () => { From 44c453af2913a735dac1dfd1841f39b23c027113 Mon Sep 17 00:00:00 2001 From: ugur-vaadin Date: Wed, 27 Mar 2024 22:25:36 +0200 Subject: [PATCH 17/20] Revert "test: update material visual test reference image" This reverts commit f180f2bd99217696287a46de8c362129a3d8396e. --- .../grid-pro/baseline/edit-column-select.png | Bin 3849 -> 3849 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/packages/grid-pro/test/visual/material/screenshots/grid-pro/baseline/edit-column-select.png b/packages/grid-pro/test/visual/material/screenshots/grid-pro/baseline/edit-column-select.png index a1e5bf16ffc95f5302de447ceae6cc6223d9a1f2..7310a01ebfed3d1557dc37f3c3ebf73e6141c126 100644 GIT binary patch delta 3516 zcmY*cXHb*d+6^sKL+C|>06Bn&R29U~yCO(cjP#-+(gY5o5CbF>X_5m7s5FHTlomQt z0)!q52oY%k6r>Y+=X;&+-kEb}-u>g9+4GdW_OsU7apG~}DJB9aDK-%sq*0@Wr^hBq zzgoDED6sGH;tm{j&;N!rpChs&pe;*At^RG#uN@bs2(up%qqCFm`sP>$6q{-$X-x-B zjdxbw`drFp`5G=KnwWm1_LCza>UT3)H+*I{%0cLdqydMqIUg@&>#L!}tN`tVjDmVy`e zGyIQ860NkQYdM4oPvXkQ7}Nsz(i_JPi4h%D)Ndz*jNbZ_^l$*fEGs{BRGy|S~=WZ$EtTirz{%q#Vd~X5S z!183BA}t3OT(ipysh^tXkmMik7Z<)**KoNXRf0j&zO$`!cLz*j`t8-xxlH~NJMDAU zwa)2yWABzYfjC&DYhMq0MlC04#9=J{-j^!nNE;ir0EuXG`$64rit30LXPFs^Y(n9b zd6BmAE0M)kI)`ZX=vU%vFu}}3znA$3>2z#ygZ5DLJtg=5g7n{0$2o$}qteM_BVw1X ztpFsZU@6CSerf4_>y6k2Zog?WTTg*Te=(&b{WK}F)DeU3vsY3mZ7vE`$UQ6JMN6${ z>p<8Z4?inO7k?)eK4c`<2=ORUPWXJe;EM%++2)APrJY*=VqVzF65Se(d<}@PzSQ2i zaJu`R#D)$lhcqEA^-@JVssOkooqFW;o12tr=y~UBSAZZQ(%BS!YVhv{r?toQ9Ug%` z=Xp;DtU_N3{OnGBg*koJ{=EB$6%0w?$TSBxlp3VMzx&jT@xkRWbk>mY@H6v4qLm5; zR{xyJzEz#zK~>_P{VWRX9Ptq(5CjoC`PQbX%tltZ1aFcAigx%R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UA`PX;^TCu%TY z2|;e$xB-ySZ+(tfTwH88a0}=fI6+fU5cgacKXOr~Vh`1{kXk6B3_}r<2a@!HpGuRp9HyGOlF*GlZ)A}PvWX_B6tfb6aDS`P?|mksg!^m` zpd28(@aE=%&n@J=wT26f%Yn=`SGG@0v?v6KrM_Q1yl6#)1H(hKv+M0SU^bSVL{@9Q zG3z{e7%0pd$xPGR=sYgAvQKWIF39q0Jre|8EFF6$c|i8q#U(SJZj?K8iYt4erMP?^ z-~(JQxVK!{Be!*Q6UZxvL2n~95B|VHUF~?fKHW_nk_L=jmaS^Bw-PjXhf2PSgG#;^ zx2JAa-K~I-M_ZFL4o-SiAQUcds9X6Oal;8rU)iJ!MGRx(+3yq}Y06vgV~Gl2O) zl1kvkvmfp77!?|w>Ya!hUL^E1DByw+eGz|F-i`R}Y@gCO+P$4wRkltU@e2;_HPDG# zNj1o7#Sqf51!|>LKYmAfMpho%lI40n^G}?olkmkH;mU0B%lpCw>s9%_aY7{2Ld(ic z-ke$IEq0;5i;m6n9AUV1qJ`#a&e(F402O2d3)=P#OGb;_E^l>klG5y~(OxoS_waSljyh32M(CYfIv9M~Fn-q!jk?kL2aiS2?C+H!h!Tr9o?!p+{W!|{b=9AiOF=oyz z9nd+jHAgTu*GW2jY(9E;B!ZMD&E`_&&Y@Sl@cMOVk>FMj1W=Xpe|x4~m|7{VJwpjk Q00D<7!2(~3BXNcQ58JbbssI20 From c3136e95b672a152960898e25b3d74cf279592b4 Mon Sep 17 00:00:00 2001 From: ugur-vaadin Date: Wed, 27 Mar 2024 22:29:05 +0200 Subject: [PATCH 18/20] test: skip new test on firefox --- packages/grid-pro/test/edit-column-type.common.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/grid-pro/test/edit-column-type.common.js b/packages/grid-pro/test/edit-column-type.common.js index f0281b6486..adc75e3377 100644 --- a/packages/grid-pro/test/edit-column-type.common.js +++ b/packages/grid-pro/test/edit-column-type.common.js @@ -6,6 +6,7 @@ import { fixtureSync, focusin, focusout, + isFirefox, keyDownChar, nextFrame, nextRender, @@ -365,7 +366,7 @@ describe('edit column editor type', () => { expect(editor).to.be.not.ok; }); - it('should not start edit with first character selected', async () => { + (isFirefox ? it.skip : it)('should not start edit with first character selected', async () => { column = grid.querySelector('[path="name"]'); cell = getContainerCell(grid.$.items, 0, columns.indexOf(column)); cell.focus(); From 74277adae95c92ede933788dcd99953de6e3cfa9 Mon Sep 17 00:00:00 2001 From: ugur-vaadin Date: Wed, 27 Mar 2024 22:36:19 +0200 Subject: [PATCH 19/20] test: revert test skip change --- packages/grid-pro/test/keyboard-navigation.common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/grid-pro/test/keyboard-navigation.common.js b/packages/grid-pro/test/keyboard-navigation.common.js index a45ad9f793..7fc7400e84 100644 --- a/packages/grid-pro/test/keyboard-navigation.common.js +++ b/packages/grid-pro/test/keyboard-navigation.common.js @@ -113,7 +113,7 @@ describe('keyboard navigation', () => { expect(getCellEditor(firstCell)).to.be.not.ok; }); - it('should focus correct editable cell after column reordering', () => { + it.skip('should focus correct editable cell after column reordering', () => { grid.columnReorderingAllowed = true; const headerContent = [ getContainerCell(grid.$.header, 0, 0)._content, From 8ea9a5290df4089043476e22a006a0a117bdac86 Mon Sep 17 00:00:00 2001 From: Ugur Saglam <106508695+ugur-vaadin@users.noreply.github.com> Date: Thu, 28 Mar 2024 13:00:10 +0200 Subject: [PATCH 20/20] Update packages/grid-pro/test/edit-column-type.common.js Co-authored-by: Sergey Vinogradov --- packages/grid-pro/test/edit-column-type.common.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/grid-pro/test/edit-column-type.common.js b/packages/grid-pro/test/edit-column-type.common.js index adc75e3377..aa77616ca8 100644 --- a/packages/grid-pro/test/edit-column-type.common.js +++ b/packages/grid-pro/test/edit-column-type.common.js @@ -371,7 +371,6 @@ describe('edit column editor type', () => { cell = getContainerCell(grid.$.items, 0, columns.indexOf(column)); cell.focus(); await sendKeys({ down: 'a' }); - await nextFrame(); await sendKeys({ down: 'b' }); await sendKeys({ down: 'Enter' }); expect(cell._content.textContent).to.equal('ab');