fix: add numeric keypad hints for weight and repetitions fields on mobile#1273
fix: add numeric keypad hints for weight and repetitions fields on mobile#1273Mehak-mahajan wants to merge 3 commits into
Conversation
| } | ||
| }, | ||
| htmlInput:{ | ||
| inputMode: 'numeric' |
There was a problem hiding this comment.
better make this a decimal as well (while it's true that you can't do partial repetitions, this field is also used for other units such as "meters", where it does make sense)
|
Hey! Thanks for the PR! I just left you a small nitpick. Another thing, if you have the motivation, do you want to check other places where we enter numbers? We'd have the same problem with the keyboard there as well |
|
"Thanks for the review! I've made the following updates: Changed repetitions field from numeric to decimal as suggested Please let me know if any further changes are needed!" |
|
Pulled this branch to check the CI failure and it's a real syntax error, not a flaky run.
slotProps={{
input: {
endAdornment: <Typography>{t('server.kg')}</Typography>
}
htmlInput: { inputMode: 'decimal' } // <- no comma above, and this isn't inside `input`'s braces either
}}That's what's failing the build step in CI ( Separately, and maybe more important: issue #2409 is specifically about the workout set-logging fields (repetitions + weight, entered during a workout), not the BMI calculator. Looking at Happy to see this land once it's green — just flagging so it doesn't merge broken. |
|
"Thanks for the detailed review! I've made the following fixes: Fixed the missing comma/syntax error in BmiCalculator.tsx between input and htmlInput in slotProps Regarding the BmiCalculator.tsx changes — the maintainer @rolandgeider suggested checking other places where numbers are entered, so I added inputMode: 'decimal' there as well. Happy to remove those changes if they are out of scope for this issue! |
Fixes #2409 (wger-project/wger)
Problem
On mobile browsers (iOS Safari, Chrome), the workout log input fields
for repetitions and weight show a full text keyboard instead of a
numeric keypad, making it slower to enter values during workouts.
Solution
Added inputMode hints to the input fields:
This tells mobile browsers to show the appropriate numeric keypad
while preserving existing functionality.
Testing
Tested on mobile browser - numeric keypad now appears when tapping
weight and repetitions fields.