change: form actions to safe client side handlers
This commit is contained in:
@@ -91,10 +91,10 @@ function OrderTrackingPage() {
|
||||
|
||||
const handlePositionSelect = (position: [number, number]) => {
|
||||
setSelectedPosition((prev) => {
|
||||
if(prev === position) {
|
||||
if (prev === position) {
|
||||
return prev;
|
||||
}
|
||||
setSelectedAddress(null);
|
||||
setSelectedAddress(null);
|
||||
return position;
|
||||
});
|
||||
setBottomSheet1State(position && true);
|
||||
@@ -142,8 +142,10 @@ function OrderTrackingPage() {
|
||||
}
|
||||
};
|
||||
|
||||
const submitAddressAction = () => {
|
||||
|
||||
const submitAddressAction = (e: React.FormEvent<HTMLFormElement>) => {
|
||||
e.preventDefault();
|
||||
const formData = new FormData(e.currentTarget);
|
||||
console.log(formData);
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -203,7 +205,7 @@ function OrderTrackingPage() {
|
||||
onClick={toggleBottomSheet2}
|
||||
overrideClassName='bg-container!'
|
||||
>
|
||||
<form action={submitAddressAction}>
|
||||
<form onSubmit={submitAddressAction}>
|
||||
<div className='px-4'>
|
||||
<div className='px-4 mt-2 bg-container'>
|
||||
<span className='text-sm'>
|
||||
|
||||
Reference in New Issue
Block a user