diff --git a/src/components/Directory/ManageDirectory.jsx b/src/components/Directory/ManageDirectory.jsx index 5c858815..6b7cf8ff 100644 --- a/src/components/Directory/ManageDirectory.jsx +++ b/src/components/Directory/ManageDirectory.jsx @@ -40,7 +40,7 @@ const ManageDirectory = ({ submitContact, onCLosed }) => { const { designationList, loading: designloading } = useDesignation(); const { contactTags, loading: Tagloading } = useContactTags(); const [IsSubmitting, setSubmitting] = useState(false); - const [showSuggestions,setShowSuggestions] = useState(false); + const [showSuggestions, setShowSuggestions] = useState(false); const [filteredDesignationList, setFilteredDesignationList] = useState([]); const dispatch = useDispatch(); @@ -132,6 +132,12 @@ const ManageDirectory = ({ submitContact, onCLosed }) => { setValue("designation", val); }; + // Handle phone number input to only allow numbers and max length of 10 + const handlePhoneInput = (e) => { + const value = e.target.value.replace(/[^0-9]/g, ""); + e.target.value = value.slice(0, 10); + }; + const toggleBucketId = (id) => { const updated = watchBucketIds?.includes(id) @@ -277,23 +283,11 @@ const ManageDirectory = ({ submitContact, onCLosed }) => { placeholder="email@example.com" /> {index === emailFields.length - 1 ? ( - //