Skip to content

Commit

Permalink
Merge pull request #49 from kaishuu0123/fix/re-53-auto-focus-to-story…
Browse files Browse the repository at this point in the history
…-modal

refs RE-53: Fix auto focus for StoryModal & TaskModal Refresh Button
  • Loading branch information
kaishuu0123 authored Dec 13, 2019
2 parents 99bcff5 + 3f86bbe commit 9f4335b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
8 changes: 8 additions & 0 deletions app/javascript/components/commons/TicketForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ export default {
this.$refs.titleInput.focus()
})
},
watch: {
isLoading: function(newLoading, oldLoading) {
Vue.nextTick(() => {
// Focus Input
this.$refs.titleInput.focus()
})
}
},
methods: {
updateValue(key, value) {
this.ticket[key] = value;
Expand Down
8 changes: 7 additions & 1 deletion app/javascript/components/kanban/TaskModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@
<i class="fas fa-pen mr-1" /> {{ $t('action.edit') }}
</button>
</div>
<div v-else-if="isEdit && !isNew" class="mr-2">
<button type="button" class="btn rb-btn-s btn-outline-secondary shadow-sm" @click="() => this.$refs.ticketForm.handleSubmit()">
<i class="fas fa-pen mr-1" /> {{ $t('action.submit') }}
</button>
</div>
<button type="button" class="btn rb-btn-s btn-outline-secondary shadow-sm" @click="() => this.$refs.modal.hide()">
<i class="fas fa-times mr-1" /> {{ $t('action.close') }}
</button>
Expand Down Expand Up @@ -103,7 +108,8 @@
:ticket="task"
ticketType="tasks"
:isLoading="isLoading"
:afterSubmit="afterSubmit" />
:afterSubmit="afterSubmit"
ref="ticketForm" />
<TicketPreview
v-else
:projectId="projectId"
Expand Down

0 comments on commit 9f4335b

Please sign in to comment.