Skip to content

Commit

Permalink
Fixed: spacing issue and capitalize first letter
Browse files Browse the repository at this point in the history
  • Loading branch information
joriordan332 committed Oct 8, 2024
1 parent a3b1bed commit 2bd06e2
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
29 changes: 29 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hot-toast": "^2.4.1",
"react-icon": "^1.0.0",
"react-icons": "^5.3.0",
"react-router-dom": "^6.26.0",
"tailwind-merge": "^2.5.2",
Expand Down
3 changes: 2 additions & 1 deletion src/components/ManageListForms/AddItemForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ export default function AddItemForm({ listPath, data, handleOpenModal }) {

const formattedItemName = formData.itemName
.toLowerCase()
.replace(/[^a-z]/g, '');
.replace(/^\s\s*/, '')
.replace(/\s\s*$/, '');

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

Expand Down

0 comments on commit 2bd06e2

Please sign in to comment.