diff options
Diffstat (limited to 'app/assets/javascripts/new_branch_form.js')
-rw-r--r-- | app/assets/javascripts/new_branch_form.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/assets/javascripts/new_branch_form.js b/app/assets/javascripts/new_branch_form.js index a7c2e572037..9d07f435620 100644 --- a/app/assets/javascripts/new_branch_form.js +++ b/app/assets/javascripts/new_branch_form.js @@ -10,12 +10,12 @@ export default class NewBranchForm { } addBinding() { - this.name.addEventListener('blur', this.validate); + this.name.addEventListener('change', this.validate); } init() { if (this.name != null && this.name.value.length > 0) { - const event = new CustomEvent('blur'); + const event = new CustomEvent('change'); this.name.dispatchEvent(event); } } @@ -77,6 +77,7 @@ export default class NewBranchForm { const errors = this.restrictions.reduce(validator, []); if (errors.length > 0) { this.branchNameError.textContent = errors.join(', '); + this.name.focus(); } } } |