Fix bug non emptyable phones and urls

This commit is contained in:
Charles Bochet
2023-10-02 17:32:10 +02:00
parent 965a6b7c57
commit 37475f7c1b
2 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@ export const usePhoneField = () => {
const persistField = usePersistField();
const persistPhoneField = (newPhoneValue: string) => {
if (!isPossiblePhoneNumber(newPhoneValue)) return;
if (!isPossiblePhoneNumber(newPhoneValue) && newPhoneValue !== '') return;
persistField(newPhoneValue);
};

View File

@ -26,7 +26,7 @@ export const useURLField = () => {
const persistField = usePersistField();
const persistURLField = (newValue: string) => {
if (!isURL(newValue)) {
if (!isURL(newValue) && newValue !== '') {
return;
}