Skip to content

Commit 200d6a6

Browse files
committed
Fix: updated Regex to not allow numbers and special characters
1 parent 2bd06e2 commit 200d6a6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/ManageListForms/AddItemForm.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ export default function AddItemForm({ listPath, data, handleOpenModal }) {
3131
const formattedItemName = formData.itemName
3232
.toLowerCase()
3333
.replace(/^\s\s*/, '')
34-
.replace(/\s\s*$/, '');
34+
.replace(/\s\s*$/, '')
35+
.replace(/[^a-zA-Z ]/g, '');
3536

3637
const match = data.find((item) => item.name === formattedItemName);
3738

0 commit comments

Comments
 (0)