diff --git a/packages/nc-gui/components/cell/SingleSelect.vue b/packages/nc-gui/components/cell/SingleSelect.vue index 4423cc0479..fa84c7910b 100644 --- a/packages/nc-gui/components/cell/SingleSelect.vue +++ b/packages/nc-gui/components/cell/SingleSelect.vue @@ -254,12 +254,6 @@ const onKeydown = (e: KeyboardEvent) => { if (e.key === 'Escape') { isOpen.value = false - - if (isForm.value) return - - setTimeout(() => { - aselect.value?.$el.querySelector('.ant-select-selection-search > input').focus() - }, 100) } } diff --git a/packages/nc-gui/composables/useMultiSelect/index.ts b/packages/nc-gui/composables/useMultiSelect/index.ts index e97755ba5b..d1b708961a 100644 --- a/packages/nc-gui/composables/useMultiSelect/index.ts +++ b/packages/nc-gui/composables/useMultiSelect/index.ts @@ -764,14 +764,6 @@ export function useMultiSelect( } } - // Handle escape - if (e.key === 'Escape') { - selectedRange.clear() - - activeCell.col = null - activeCell.row = null - } - if (unref(editEnabled) || e.ctrlKey || e.altKey || e.metaKey) { return true } diff --git a/tests/playwright/pages/Dashboard/Grid/index.ts b/tests/playwright/pages/Dashboard/Grid/index.ts index b1d9bd9887..e0d2c0f7e2 100644 --- a/tests/playwright/pages/Dashboard/Grid/index.ts +++ b/tests/playwright/pages/Dashboard/Grid/index.ts @@ -211,6 +211,11 @@ export class GridPage extends BasePage { return await expect(this.get().locator(`td[data-testid="cell-Title-${index}"]`)).toHaveCount(0); } + async clickRow(index: number, title = 'Title') { + await this.get().getByTestId(`cell-${title}-${index}`).click(); + await this.rootPage.waitForTimeout(300); + } + async deleteRow(index: number, title = 'Title') { await this.get().getByTestId(`cell-${title}-${index}`).click({ button: 'right', diff --git a/tests/playwright/pages/Dashboard/WebhookForm/index.ts b/tests/playwright/pages/Dashboard/WebhookForm/index.ts index 264bfa217c..d94a4b524d 100644 --- a/tests/playwright/pages/Dashboard/WebhookForm/index.ts +++ b/tests/playwright/pages/Dashboard/WebhookForm/index.ts @@ -150,11 +150,11 @@ export class WebhookFormPage extends BasePage { await this.get().locator(`.ant-tabs-tab-btn:has-text("Headers")`).click(); await this.rootPage.waitForTimeout(500); - await this.get().locator('.nc-input-hook-header-key').click(); + await this.get().locator('.nc-input-hook-header-key input').click(); await this.rootPage.waitForTimeout(500); // kludge, as the dropdown is not visible even after scroll into view - await this.rootPage.locator('.nc-input-hook-header-key').pressSequentially(key); + await this.rootPage.locator('.nc-input-hook-header-key input').pressSequentially(key); await this.rootPage .locator('.ant-select-dropdown:visible') .locator(`.ant-select-item:has-text("${key}")`) diff --git a/tests/playwright/tests/db/features/undo-redo.spec.ts b/tests/playwright/tests/db/features/undo-redo.spec.ts index 3a03beea38..b8bbaa4613 100644 --- a/tests/playwright/tests/db/features/undo-redo.spec.ts +++ b/tests/playwright/tests/db/features/undo-redo.spec.ts @@ -144,7 +144,9 @@ test.describe('Undo Redo', () => { await verifyRecords([555, 666]); // Row.Delete + await grid.clickRow(10, 'Number'); await grid.deleteRow(10, 'Number'); + await grid.clickRow(10, 'Number'); await grid.deleteRow(10, 'Number'); await verifyRecords([]); diff --git a/tests/playwright/tests/db/features/webhook.spec.ts b/tests/playwright/tests/db/features/webhook.spec.ts index fa3e30e377..dbe54ba028 100644 --- a/tests/playwright/tests/db/features/webhook.spec.ts +++ b/tests/playwright/tests/db/features/webhook.spec.ts @@ -173,6 +173,7 @@ test.describe.serial('Webhook', () => { // verify that the hook is not triggered (count doesn't change in this case) await dashboard.grid.editRow({ index: 0, value: 'Delaware' }); await verifyHookTrigger(1, null, request); + await dashboard.grid.clickRow(0); await dashboard.grid.deleteRow(0); await verifyHookTrigger(1, null, request); @@ -208,6 +209,7 @@ test.describe.serial('Webhook', () => { request, buildExpectedResponseData('records.after.update', 'Delaware', 'Poole') ); + await dashboard.grid.clickRow(0); await dashboard.grid.deleteRow(0); await verifyHookTrigger(3, 'Delaware', request); @@ -241,6 +243,7 @@ test.describe.serial('Webhook', () => { request, buildExpectedResponseData('records.after.update', 'Delaware', 'Poole') ); + await dashboard.grid.clickRow(0); await dashboard.grid.deleteRow(0); await verifyHookTrigger(4, 'Delaware', request, buildExpectedResponseData('records.after.delete', 'Delaware')); @@ -282,6 +285,7 @@ test.describe.serial('Webhook', () => { await verifyHookTrigger(0, 'Poole', request); await dashboard.grid.editRow({ index: 0, value: 'Delaware' }); await verifyHookTrigger(0, 'Delaware', request); + await dashboard.grid.clickRow(0); await dashboard.grid.deleteRow(0); // for delete, the hook should be triggered (thrice in this case) @@ -313,6 +317,7 @@ test.describe.serial('Webhook', () => { await verifyHookTrigger(0, '', request); await dashboard.grid.editRow({ index: 0, value: 'Delaware' }); await verifyHookTrigger(0, '', request); + await dashboard.grid.clickRow(0); await dashboard.grid.deleteRow(0); await verifyHookTrigger(0, '', request); }); @@ -397,7 +402,9 @@ test.describe.serial('Webhook', () => { request, buildExpectedResponseData('records.after.update', 'Poole', 'Delaware') ); + await dashboard.grid.clickRow(1); await dashboard.grid.deleteRow(1); + await dashboard.rootPage.waitForTimeout(3000); await dashboard.grid.deleteRow(0); await verifyHookTrigger(3, 'Poole', request, buildExpectedResponseData('records.after.delete', 'Poole')); @@ -439,6 +446,7 @@ test.describe.serial('Webhook', () => { request, buildExpectedResponseData('records.after.update', 'Poole', 'Delaware') ); + await dashboard.grid.clickRow(1); await dashboard.grid.deleteRow(1); await dashboard.grid.deleteRow(0); await verifyHookTrigger(8, 'Delaware', request, buildExpectedResponseData('records.after.delete', 'Delaware')); @@ -802,6 +810,8 @@ test.describe.serial('Webhook', () => { }); } + await dashboard.grid.clickRow(0); + // Select one record and delete await dashboard.grid.selectRow(0); await dashboard.grid.deleteSelectedRows();