Skip to content

Commit

Permalink
Merge pull request #34 from the-collab-lab/av-success-error-messages
Browse files Browse the repository at this point in the history
onChange now clears submit message
  • Loading branch information
DwightTheShark committed May 20, 2023
2 parents 7ca8ef0 + 8e0b1f0 commit 38af4d1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/views/AddItem.jsx
Expand Up @@ -9,6 +9,10 @@ export function AddItem({ data, listId }) {
const [submitMessage, setSubmitMessage] = useState('');

const onChange = (e) => {
if (submitMessage) {
setSubmitMessage('');
}

if (e.target.name === 'daysTillNextPurchase') {
setItemData((itemData) => ({
...itemData,
Expand Down

0 comments on commit 38af4d1

Please sign in to comment.