Skip to content

Commit

Permalink
Display validation errors of file name field in DAM (v6) (#2548)
Browse files Browse the repository at this point in the history
Backport of #2547
  • Loading branch information
thomasdax98 committed Sep 19, 2024
1 parent fe368d2 commit 1132fc6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/thirty-lemons-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@comet/cms-admin": patch
---

Display validation errors of file name field in DAM
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ export const FileSettingsFields = ({ file }: SettingsFormProps): React.ReactElem
}
}}
onBlur={() => {
formApi.blur("name");

const filename: string | undefined = formApi.getFieldState("name")?.value;
const nameWithoutExtension = filename?.split(".").slice(0, -1).join(".");
const extension = file.name.split(".").pop();
Expand Down

0 comments on commit 1132fc6

Please sign in to comment.