Skip to content

Commit

Permalink
Update formv2.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
jbud committed Dec 6, 2023
1 parent 3d6104b commit c2bd18e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/form/formv2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const Form = (props: Props) => {
}, [simbreifData]);

useEffect(() => {
icaoRef.current!.blur();
if (icaoManual.length === 4) icaoRef.current!.blur();
}, [icaoManual]);

useEffect(() => {
Expand Down Expand Up @@ -177,6 +177,7 @@ const Form = (props: Props) => {

const handleICAOChange = (e: ChangeEvent<HTMLInputElement>) => {
e.target.value = e.target.value.toUpperCase();
setIcaoManual(e.target.value);
setFormContent({ ...formContent, icao: e.target.value });
};

Expand Down Expand Up @@ -215,6 +216,7 @@ const Form = (props: Props) => {
};
const handleRunwayChange = (e: ChangeEvent<HTMLInputElement>) => {
setFormContent({ ...formContent, runway: e.target.value });
setRwManual(e.target.value);
const rw = runways!.find((rw) => rw.value === e.target.value);
if (rw) {
changeSettings('runwayAltitude', parseInt(rw.elevation!));
Expand Down Expand Up @@ -244,6 +246,7 @@ const Form = (props: Props) => {
};
const handleWeightChange = (e: ChangeEvent<HTMLInputElement>) => {
setFormContent({ ...formContent, weight: parseInt(e.target.value) });
setWeightManual(parseInt(e.target.value));
changeSettings('tow', parseInt(e.target.value));
setCalculateDisabled(false);
setFormValidation((valid) => {
Expand Down

0 comments on commit c2bd18e

Please sign in to comment.