Skip to content

Allow the user to input into auto height proportions box#1887

Open
Aed-1 wants to merge 5 commits into
server-rewritefrom
aed/scaled-proportions-input
Open

Allow the user to input into auto height proportions box#1887
Aed-1 wants to merge 5 commits into
server-rewritefrom
aed/scaled-proportions-input

Conversation

@Aed-1

@Aed-1 Aed-1 commented Jun 30, 2026

Copy link
Copy Markdown
Member
2026-07-01.00-42-09.mp4

@Aed-1
Aed-1 force-pushed the aed/scaled-proportions-input branch from 127182f to 7fae149 Compare July 4, 2026 20:05
newFullHeight = Number(values.height.replace(/[ m]/g, ''));

if (isNaN(newFullHeight)) {
setTimeout(() => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a set timeout of 0?

you are most likely doing something wrong.

}, [defaultValues.height]);

useEffect(() => {
setTimeout(() => reset({ height: formattedHeight }), 0);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like wth

height: formattedHeight,
};

const { reset, control, watch, getValues, setError, clearErrors } = useForm<{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useForm has a validator system. use that instesd with yup

setHmdHeight(round4Digit(newFullHeight * EYE_HEIGHT_TO_HEIGHT_RATIO));
}
} else {
const match = values.height.match(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for that if you use useForm validation stuff

newFullHeight = convert(feet + inches / 12, 'foot').to('meter');

// bounds detection
if ((feet > 8 && inches > 4) || feet > 8) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (feet > 8 || (feet === 8 && inches > 4)) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants