fix: Undefined in MediaDimensions (#10164)

This commit is contained in:
Tom Moor
2025-09-13 21:10:05 +02:00
committed by GitHub
parent 7d69198c91
commit 3ab3117e11
2 changed files with 8 additions and 6 deletions

View File

@@ -33,8 +33,8 @@ export function MediaDimension() {
height = node.attrs.height as number;
const [localDimension, setLocalDimension] = useState<Dimension>(() => ({
width: String(width),
height: String(height),
width: width ? String(width) : "",
height: height ? String(height) : "",
changed: "none",
}));
const [error, setError] = useState<{ width: boolean; height: boolean }>({
@@ -59,8 +59,8 @@ export function MediaDimension() {
const reset = useCallback(() => {
setLocalDimension({
width: String(width),
height: String(height),
width: width ? String(width) : "",
height: height ? String(height) : "",
changed: "none",
});
setError({ width: false, height: false });
@@ -209,6 +209,7 @@ export function MediaDimension() {
<StyledInput
label={t("Image width")}
labelHidden
placeholder={t("Width")}
value={localDimension.width}
onChange={handleChange("width")}
onBlur={handleBlur}
@@ -221,6 +222,7 @@ export function MediaDimension() {
<StyledInput
label={t("Image height")}
labelHidden
placeholder={t("Height")}
value={localDimension.height}
onChange={handleChange("height")}
onBlur={handleBlur}

View File

@@ -468,7 +468,9 @@
"Replace": "Replace",
"Replace all": "Replace all",
"Image width": "Image width",
"Width": "Width",
"Image height": "Image height",
"Height": "Height",
"Profile picture": "Profile picture",
"Create a new doc": "Create a new doc",
"{{ userName }} won't be notified, as they do not have access to this document": "{{ userName }} won't be notified, as they do not have access to this document",
@@ -497,8 +499,6 @@
"Create a new child doc": "Create a new child doc",
"Delete table": "Delete table",
"Delete file": "Delete file",
"Width": "Width",
"Height": "Height",
"Download file": "Download file",
"Replace file": "Replace file",
"Delete image": "Delete image",