Fix column not being saved properly (#1429)

* Fix email column not being saved

* Fix URL fields not being clearable

* Fix phone number clearing
This commit is contained in:
Ragnar Laud
2023-09-04 16:42:10 +03:00
committed by GitHub
parent 3a0f02f2f2
commit 1a71f61d24
3 changed files with 20 additions and 2 deletions

View File

@ -30,7 +30,7 @@ export function GenericEditableURLCellEditMode({ columnDefinition }: OwnProps) {
function handleSubmit(newText: string) {
if (newText === fieldValue) return;
if (!isURL(newText)) return;
if (newText !== '' && !isURL(newText)) return;
setFieldValue(newText);

View File

@ -85,7 +85,10 @@ export function PhoneCellEdit({
const wrapperRef = useRef<HTMLDivElement | null>(null);
function handleSubmit() {
if (isPossiblePhoneNumber(internalValue ?? '')) {
if (
internalValue === undefined ||
isPossiblePhoneNumber(internalValue ?? '')
) {
onSubmit(internalValue ?? '');
}
}