Skip to content

Commit

Permalink
state update bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Nobatgeldi committed Oct 10, 2023
1 parent c22eb7c commit 69d155a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/covisart/Product.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const Product = () => {
const handleSubmit = event => {
event.preventDefault(); // 👈️ prevent page refresh

uploadData(snap)
uploadData(state)
openNotification()
};
return (
Expand Down Expand Up @@ -181,9 +181,9 @@ const Product = () => {
<form style={{ display: 'flex', width: "100%" }}
onSubmit={handleSubmit}>
<Space direction="vertical" size="middle" style={{ display: 'flex', width: "100%" }}>
<input required type='text' placeholder="Name" onChange={(e) => { state.name = e.currentTarget.value }} />
<input required type='text' placeholder="Phone" onChange={(e) => { state.phone = e.currentTarget.value }} />
<input required type='email' placeholder="E-mail" onChange={(e) => { state.email = e.currentTarget.value }} />
<input id="name" required type='text' placeholder="Name" onInput={(e)=>{console.log(e.currentTarget.value)}} onChange={(e) => { state.name = e.currentTarget.value; console.log(e.currentTarget.value) }} />
<input id="phone" required type='text' placeholder="Phone" onChange={(e) => { state.phone = e.currentTarget.value }} />
<input id="email" required type='email' placeholder="E-mail" onChange={(e) => { state.email = e.currentTarget.value }} />
<button className="btn-default btn-border" type="submit" value="Order">Order</button >
</Space>
</form>
Expand Down

0 comments on commit 69d155a

Please sign in to comment.