Skip to content

Commit

Permalink
Fixed limit to 4
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaJ2305 committed Nov 18, 2024
1 parent fc72679 commit b798481
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/components/Facility/TransferPatientDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,14 @@ const TransferPatientDialog = (props: Props) => {
const maxYear = new Date().getFullYear();

const handleChange = (e: FieldChangeEvent<unknown>) => {
dispatch({
type: "set_form",
form: { ...state.form, [e.name]: e.value },
});
const value = String(e.value);

if (value.length <= 4) {
dispatch({
type: "set_form",
form: { ...state.form, [e.name]: e.value },
});
}
};

const handleOnBlur = (e: React.FocusEvent<HTMLInputElement>) => {
Expand Down

0 comments on commit b798481

Please sign in to comment.