Skip to content

Commit

Permalink
Merge pull request #48 from the-collab-lab/jo-fix-spacing
Browse files Browse the repository at this point in the history
Fix spacing issue
  • Loading branch information
joriordan332 authored Oct 11, 2024
2 parents ee96b28 + 200d6a6 commit 5d88730
Show file tree
Hide file tree
Showing 3 changed files with 33 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
4 changes: 3 additions & 1 deletion src/components/ManageListForms/AddItemForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ export default function AddItemForm({ listPath, data, handleOpenModal }) {

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

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

Expand Down

0 comments on commit 5d88730

Please sign in to comment.