diff options
| author | xengineering <me@xengineering.eu> | 2024-05-15 19:20:01 +0200 |
|---|---|---|
| committer | xengineering <me@xengineering.eu> | 2024-05-15 19:20:01 +0200 |
| commit | d8b40f0a0a2ac2bcb8b9b690166ae7594c067298 (patch) | |
| tree | d636873a47c20072119d97f2c5a8d1b0d878d6c2 | |
| parent | dfee08b810d2c8ec5883dc8e8ec8a143abd2e961 (diff) | |
| download | ceres-d8b40f0a0a2ac2bcb8b9b690166ae7594c067298.tar ceres-d8b40f0a0a2ac2bcb8b9b690166ae7594c067298.tar.zst ceres-d8b40f0a0a2ac2bcb8b9b690166ae7594c067298.zip | |
When adding a recipe step or an ingredient the browser should focus on
the first text input of that new element.
This supports using Ceres without a mouse and only with tab-based
navigation with a keyboard.
| -rw-r--r-- | view/static/ceres.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/view/static/ceres.js b/view/static/ceres.js index 2405a59..91417a7 100644 --- a/view/static/ceres.js +++ b/view/static/ceres.js @@ -103,6 +103,7 @@ function addNewStep() { let step = template.content.cloneNode(true); steps.appendChild(step); + steps.lastElementChild.firstElementChild.focus(); } function addNewIngredient(button) { @@ -112,4 +113,5 @@ function addNewIngredient(button) { let ingredient = template.content.cloneNode(true); ingredients.appendChild(ingredient); + ingredients.lastElementChild.firstElementChild.focus(); } |
