diff --git a/src/app.js b/src/app.js index feb5cf5..4875995 100644 --- a/src/app.js +++ b/src/app.js @@ -1974,6 +1974,14 @@ } renderEditPhotos(); editDialog.showModal(); + // Without an explicit focus the browser autofocuses the first control — + // the date input — and iOS immediately pops the calendar over the form. + // Land on the first relevant text field instead (same trick and delay as + // openNoteDialog: synchronous focus can be lost while the dialog settles). + const focusTarget = !editWeightField.hidden ? editWeight + : !editGramsField.hidden ? editGrams + : editNote; + setTimeout(() => focusTarget.focus(), 50); } editPhotoBtn.addEventListener("click", () => editPhotoInput.click()); diff --git a/src/changelog.json b/src/changelog.json index 17078e5..7566a24 100644 --- a/src/changelog.json +++ b/src/changelog.json @@ -1,4 +1,5 @@ [ + { "date": "2026-07-15", "text": "Editing an event no longer pops the date picker over the whole screen on iPhone" }, { "date": "2026-07-15", "text": "Weight and amount fields no longer show up on events that don't use them (e.g. editing a pee)" }, { "date": "2026-07-15", "text": "The date in the top bar is shorter (no year), so the whole bar fits on smaller iPhones" }, { "date": "2026-07-13", "text": "The big timer is back at the top — scroll past it and it hops into the frozen bar instead" },