Keep focus on new step field when pressing add

This commit is contained in:
June 2025-08-15 15:37:20 +12:00
parent a9e4d5fb50
commit fbef074912
Signed by: breadone
GPG Key ID: FDC19FE143200483

View File

@ -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() {