fix: Files field fix (#7376)

## Description

Closes #7324 
Closes #7323

- This PR solves the issue - 
- #7324 
- #7323
- On Enter the rename of the file is saved
- Removed renaming of extension

## After Changes Behaviour


https://github.com/user-attachments/assets/f5c47cd4-883e-473e-9cfa-e277f8f630c2

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
Harshit Singh
2024-10-10 14:11:23 +05:30
committed by GitHub
parent 7b7c67fb64
commit 54c328a7e6
2 changed files with 42 additions and 10 deletions

View File

@ -0,0 +1,8 @@
export const getFileNameAndExtension = (filenameWithExtension: string) => {
const lastDotIndex = filenameWithExtension.lastIndexOf('.');
return {
name: filenameWithExtension.substring(0, lastDotIndex),
extension: filenameWithExtension.substring(lastDotIndex),
};
};