Allow the user to input into auto height proportions box#1887
Open
Aed-1 wants to merge 5 commits into
Open
Conversation
Aed-1
force-pushed
the
aed/scaled-proportions-input
branch
from
July 4, 2026 20:05
127182f to
7fae149
Compare
loucass003
reviewed
Jul 7, 2026
| newFullHeight = Number(values.height.replace(/[ m]/g, '')); | ||
|
|
||
| if (isNaN(newFullHeight)) { | ||
| setTimeout(() => { |
Member
There was a problem hiding this comment.
a set timeout of 0?
you are most likely doing something wrong.
loucass003
reviewed
Jul 7, 2026
| }, [defaultValues.height]); | ||
|
|
||
| useEffect(() => { | ||
| setTimeout(() => reset({ height: formattedHeight }), 0); |
loucass003
reviewed
Jul 7, 2026
| height: formattedHeight, | ||
| }; | ||
|
|
||
| const { reset, control, watch, getValues, setError, clearErrors } = useForm<{ |
Member
There was a problem hiding this comment.
useForm has a validator system. use that instesd with yup
loucass003
reviewed
Jul 7, 2026
| setHmdHeight(round4Digit(newFullHeight * EYE_HEIGHT_TO_HEIGHT_RATIO)); | ||
| } | ||
| } else { | ||
| const match = values.height.match( |
Member
There was a problem hiding this comment.
No need for that if you use useForm validation stuff
loucass003
reviewed
Jul 7, 2026
| newFullHeight = convert(feet + inches / 12, 'foot').to('meter'); | ||
|
|
||
| // bounds detection | ||
| if ((feet > 8 && inches > 4) || feet > 8) { |
Member
There was a problem hiding this comment.
if (feet > 8 || (feet === 8 && inches > 4)) {
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.
2026-07-01.00-42-09.mp4