Skip to content
Prev Previous commit
Next Next commit
Allow to advance to next step by pressing return
Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- committed Feb 21, 2023
commit 47d4e860fa62fa226ef1ab4292fd20356efc3273
9 changes: 8 additions & 1 deletion src/components/Nav/NewCollectiveModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
:error="nameIsInvalid"
:show-trailing-button="name !== ''"
:label="t('collectives', 'Name of the collective')"
@keypress.enter.prevent="advanceToMembers"
@trailing-button-click="clearName" />
<NcSelect v-else
ref="circleSelector"
Expand Down Expand Up @@ -70,7 +71,7 @@
<NcButton type="primary"
:disabled="!newCollectiveName || nameIsInvalid"
class="modal-buttons-right"
@click="state = 1">
@click="advanceToMembers">
{{ t('collectives', 'Select members') }}
</NcButton>
</div>
Expand Down Expand Up @@ -209,6 +210,12 @@ export default {
this.name = ''
},

advanceToMembers() {
if (this.newCollectiveName && !this.nameIsInvalid) {
this.state = 1
}
},

async getCircles() {
return await this.dispatchGetCircles()
.catch(displayError('Could not fetch circles'))
Expand Down