diff --git a/cypress/e2e/column-selection.cy.js b/cypress/e2e/column-selection.cy.js index 267031b18..2f125dafa 100644 --- a/cypress/e2e/column-selection.cy.js +++ b/cypress/e2e/column-selection.cy.js @@ -28,6 +28,7 @@ describe('Test column ' + columnTitle, () => { cy.get('button').contains('Create row').click() cy.get('.modal__content h2').contains('Create row').should('be.visible') cy.get('.modal__content .title').contains(columnTitle).should('be.visible') + cy.get('.modal__content .title').click() cy.get('.modal__content .select span[title="second option"]').should('be.visible') cy.get('button').contains('Save').click() cy.get('.custom-table table tr td div').contains('second option').should('be.visible') diff --git a/src/modules/modals/CreateColumn.vue b/src/modules/modals/CreateColumn.vue index 1c21fa746..0d5543287 100644 --- a/src/modules/modals/CreateColumn.vue +++ b/src/modules/modals/CreateColumn.vue @@ -212,6 +212,11 @@ export default { combinedType() { this.reset(false, false) }, + showModal() { + this.$nextTick(() => { + this.$el.querySelector('input')?.focus() + }) + }, }, methods: { snakeToCamel(str) { diff --git a/src/modules/modals/CreateRow.vue b/src/modules/modals/CreateRow.vue index 529bc5e75..d09ef65e2 100644 --- a/src/modules/modals/CreateRow.vue +++ b/src/modules/modals/CreateRow.vue @@ -88,6 +88,13 @@ export default { return mandatoryFieldsEmpty }, }, + watch: { + showModal() { + this.$nextTick(() => { + this.$el.querySelector('input')?.focus() + }) + }, + }, methods: { actionCancel() { this.reset() diff --git a/src/modules/modals/CreateTable.vue b/src/modules/modals/CreateTable.vue index 9270394c6..3eceaf1d9 100644 --- a/src/modules/modals/CreateTable.vue +++ b/src/modules/modals/CreateTable.vue @@ -20,7 +20,8 @@ {{ icon }} - this.$refs.titleInput.focus()) }, }, beforeMount() { diff --git a/src/modules/modals/ViewSettings.vue b/src/modules/modals/ViewSettings.vue index ae4ecf40e..880a015cf 100644 --- a/src/modules/modals/ViewSettings.vue +++ b/src/modules/modals/ViewSettings.vue @@ -189,6 +189,7 @@ export default { this.reset() await this.loadTableColumnsFromBE() this.open = true + this.$nextTick(() => this.$el.querySelector('input')?.focus()) } }, open(value) {