Keep focus on new step field when pressing add
This commit is contained in:
parent
a9e4d5fb50
commit
fbef074912
@ -33,7 +33,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
})
|
||||
// onclick for add button
|
||||
document.querySelector('#add-ingredient-btn')?.addEventListener('click', addIngredient);
|
||||
|
||||
|
||||
// Enter key navigation for ingredient fields
|
||||
ingredientFields[0].addEventListener('keydown', e => {
|
||||
if (e.key === 'Enter') {
|
||||
@ -95,6 +95,7 @@ function addStep() {
|
||||
renderSteps()
|
||||
stepInput.value = ''
|
||||
stepAddButton.disabled = true
|
||||
stepInput.focus()
|
||||
}
|
||||
|
||||
function renderSteps() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user