🐛 Fix change position modal not closing when value is 0 #573

This commit is contained in:
Manuel
2023-01-22 18:08:06 +01:00
parent d3abdb0150
commit 9d5948e122

View File

@@ -45,7 +45,14 @@ export const ChangePositionModal = ({
const width = parseInt(form.values.width, 10);
const height = parseInt(form.values.height, 10);
if (!form.values.x || !form.values.y || Number.isNaN(width) || Number.isNaN(height)) return;
if (
form.values.x === null ||
form.values.y === null ||
Number.isNaN(width) ||
Number.isNaN(height)
) {
return;
}
onSubmit(form.values.x, form.values.y, width, height);
};