fix(1169): focus for input unit keeps resetting while typing#1172
Merged
CodeWithCJ merged 1 commit intoCodeWithCJ:mainfrom Apr 21, 2026
Merged
fix(1169): focus for input unit keeps resetting while typing#1172CodeWithCJ merged 1 commit intoCodeWithCJ:mainfrom
CodeWithCJ merged 1 commit intoCodeWithCJ:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the focus management in the FoodUnitSelector component by replacing a callback-based ref with a useRef and a useEffect hook. This ensures the quantity input is focused and selected only when the dialog opens or the loading state changes, preventing focus issues during typing. I have no further feedback to provide.
CodeWithCJ
approved these changes
Apr 21, 2026
eleboucher
pushed a commit
to eleboucher/homelab
that referenced
this pull request
Apr 29, 2026
) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [ghcr.io/codewithcj/sparkyfitness-frontend](https://github.com/CodeWithCJ/SparkyFitness) | patch | `v0.16.5.8` → `v0.16.5.9` | | [ghcr.io/codewithcj/sparkyfitness-server](https://github.com/CodeWithCJ/SparkyFitness) | patch | `v0.16.5.8` → `v0.16.5.9` | --- ### Release Notes <details> <summary>CodeWithCJ/SparkyFitness (ghcr.io/codewithcj/sparkyfitness-frontend)</summary> ### [`v0.16.5.9`](https://github.com/CodeWithCJ/SparkyFitness/releases/tag/v0.16.5.9) [Compare Source](CodeWithCJ/SparkyFitness@v0.16.5.8...v0.16.5.9)⚠️ Backup before upgrading. If you don’t see the latest updates, please refresh or clear your browser cache.⚠️ Android App – Google Play closed testing URL has changed. Refer to the updated link in the Wiki.⚠️ Though you don't need to immediately upgrade, in the upcoming months the Postgres upgrade will be mandated. Have caution. Below guide might have flaws. Research yourself before performing the upgrade. <https://codewithcj.github.io/SparkyFitness/install/postgres-upgrade> 💙 Support SparkyFitness Support development if you find SparkyFitness useful — Approximately $250 in remaining project expenses. <!-- Release notes generated using configuration in .github/release.yml at v0.16.5.9 --> ##### What's Changed ##### Features - feat(994): goal tracking reports by [@​Sim-sat](https://github.com/Sim-sat) in [#​1206](CodeWithCJ/SparkyFitness#1206) - feat: imroved reports for nutrition data by [@​Sim-sat](https://github.com/Sim-sat) in [#​1212](CodeWithCJ/SparkyFitness#1212) ##### Fixes - fix: auto labeling for mistakenly adds bug label by [@​Sim-sat](https://github.com/Sim-sat) in [#​1207](CodeWithCJ/SparkyFitness#1207) - fix(1211): unused api endpoints by [@​Sim-sat](https://github.com/Sim-sat) in [#​1213](CodeWithCJ/SparkyFitness#1213) ##### Other Changes - App Workout Timer by [@​apedley](https://github.com/apedley) in [#​1143](CodeWithCJ/SparkyFitness#1143) - feat(781): meal calorie distribution for custom meals by [@​Sim-sat](https://github.com/Sim-sat) in [#​1145](CodeWithCJ/SparkyFitness#1145) - fix: food unit conversion behavior for compatible and incompatible variants by [@​BryceKrispiess](https://github.com/BryceKrispiess) in [#​1148](CodeWithCJ/SparkyFitness#1148) - feat(566): reorder nutrients by [@​Sim-sat](https://github.com/Sim-sat) in [#​1149](CodeWithCJ/SparkyFitness#1149) - feat(839): add averages to reports by [@​Sim-sat](https://github.com/Sim-sat) in [#​1150](CodeWithCJ/SparkyFitness#1150) - fix(1151, 1045): wger serch doesn't respect language and endpoints are deprecated by [@​Sim-sat](https://github.com/Sim-sat) in [#​1152](CodeWithCJ/SparkyFitness#1152) - Smoother App Animations by [@​BryceKrispiess](https://github.com/BryceKrispiess) in [#​1155](CodeWithCJ/SparkyFitness#1155) - feat: refresh dashboard and other tabs after sync automatically by [@​BryceKrispiess](https://github.com/BryceKrispiess) in [#​1159](CodeWithCJ/SparkyFitness#1159) - Feat: Additional app haptics by [@​BryceKrispiess](https://github.com/BryceKrispiess) in [#​1161](CodeWithCJ/SparkyFitness#1161) - fix(1156): secret file not working anymore by [@​Sim-sat](https://github.com/Sim-sat) in [#​1163](CodeWithCJ/SparkyFitness#1163) - iOS Home Screen Widget by [@​apedley](https://github.com/apedley) in [#​1157](CodeWithCJ/SparkyFitness#1157) - feat: improve ui for exercises and support cardio and isometric types by [@​Sim-sat](https://github.com/Sim-sat) in [#​1164](CodeWithCJ/SparkyFitness#1164) - fix(1158): garmin activity sync fail by [@​Sim-sat](https://github.com/Sim-sat) in [#​1166](CodeWithCJ/SparkyFitness#1166) - fix(1165): execute preflight checks before server startup by [@​Sim-sat](https://github.com/Sim-sat) in [#​1167](CodeWithCJ/SparkyFitness#1167) - feat: app logs rework and expansion by [@​apedley](https://github.com/apedley) in [#​1168](CodeWithCJ/SparkyFitness#1168) - fix: exercises add from external and public workout presets by [@​apedley](https://github.com/apedley) in [#​1171](CodeWithCJ/SparkyFitness#1171) - fix(1169): focus for input unit keeps resetting while typing by [@​Sim-sat](https://github.com/Sim-sat) in [#​1172](CodeWithCJ/SparkyFitness#1172) - fix(1139): filter active calories from workout reports by [@​apedley](https://github.com/apedley) in [#​1175](CodeWithCJ/SparkyFitness#1175) - feat(1080): add bundled postgresql resources to helm chart by [@​Sim-sat](https://github.com/Sim-sat) in [#​1178](CodeWithCJ/SparkyFitness#1178) - feat(702): support for custom uploads and backup location by [@​Sim-sat](https://github.com/Sim-sat) in [#​1179](CodeWithCJ/SparkyFitness#1179) - feat: improved ui for exercise entries by [@​Sim-sat](https://github.com/Sim-sat) in [#​1181](CodeWithCJ/SparkyFitness#1181) - feat(1044): equivalent variants for foods by [@​Sim-sat](https://github.com/Sim-sat) in [#​1182](CodeWithCJ/SparkyFitness#1182) - feat: app: change workouts tab to library by [@​apedley](https://github.com/apedley) in [#​1183](CodeWithCJ/SparkyFitness#1183) - fix: add sheet spacing after modal sheet by [@​apedley](https://github.com/apedley) in [#​1189](CodeWithCJ/SparkyFitness#1189) - fix(1180): recalc sleep after merge by [@​apedley](https://github.com/apedley) in [#​1190](CodeWithCJ/SparkyFitness#1190) - App meal creation support by [@​BryceKrispiess](https://github.com/BryceKrispiess) in [#​1195](CodeWithCJ/SparkyFitness#1195) - Fix(1187): misleading placement of height input by [@​Sim-sat](https://github.com/Sim-sat) in [#​1191](CodeWithCJ/SparkyFitness#1191) - fix: backup doesn't work with 18.3 due to old image version by [@​Sim-sat](https://github.com/Sim-sat) in [#​1192](CodeWithCJ/SparkyFitness#1192) - feat: standardize tables to allow universal filtering, pagination, bulk actions and match the UI by [@​Sim-sat](https://github.com/Sim-sat) in [#​1196](CodeWithCJ/SparkyFitness#1196) - App Android Widget by [@​apedley](https://github.com/apedley) in [#​1198](CodeWithCJ/SparkyFitness#1198) - App Meal Nutrition + UI Tweaks by [@​apedley](https://github.com/apedley) in [#​1194](CodeWithCJ/SparkyFitness#1194) - feat: improve changelog creation and auto label pr's by [@​Sim-sat](https://github.com/Sim-sat) in [#​1146](CodeWithCJ/SparkyFitness#1146) - feat: mobile nutrient display and entry details by [@​apedley](https://github.com/apedley) in [#​1205](CodeWithCJ/SparkyFitness#1205) - feat: saving selected date to search parameters and improve calendar UI by [@​Sim-sat](https://github.com/Sim-sat) in [#​1209](CodeWithCJ/SparkyFitness#1209) - fix: pr validation workflow duplicate variable by [@​Sim-sat](https://github.com/Sim-sat) in [#​1210](CodeWithCJ/SparkyFitness#1210) **Full Changelog**: <CodeWithCJ/SparkyFitness@v0.16.5.8...v0.16.5.9> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMDEuMSIsInVwZGF0ZWRJblZlciI6IjQzLjEwMS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL3BhdGNoIl19--> Reviewed-on: https://git.erwanleboucher.dev/eleboucher/homelab/pulls/315
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
What problem does this PR solve?
The input field kept resetting the focus making it hard to type.
How did you implement the solution?
Using a ref for focus.
Linked Issue: Closes #1169
How to Test
PR Type
Checklist
All PRs:
New features only:
Frontend changes (
SparkyFitnessFrontend/orsrc/):pnpm run validateand it passes.en) translation file.Backend changes (
SparkyFitnessServer/):rls_policies.sqlfor any new user-specific tables.UI changes (components, screens, pages):