fix special request input updating upon editing from the bottom sheet
This commit is contained in:
@@ -1,13 +1,20 @@
|
||||
import { Form } from "antd";
|
||||
import { useEffect } from "react";
|
||||
|
||||
import { selectCart } from "features/order/orderSlice";
|
||||
import useBreakPoint from "hooks/useBreakPoint.ts";
|
||||
import CartDesktopLayout from "pages/cart/components/CartDesktopLayout.tsx";
|
||||
import CartMobileTabletLayout from "pages/cart/components/CartMobileTabletLayout.tsx";
|
||||
import { useAppSelector } from "redux/hooks";
|
||||
|
||||
export default function CartPage() {
|
||||
const { isDesktop } = useBreakPoint();
|
||||
const [form] = Form.useForm();
|
||||
const { specialRequest } = useAppSelector(selectCart);
|
||||
|
||||
useEffect(() => {
|
||||
form.setFieldsValue({ specialRequest });
|
||||
}, [form, specialRequest]);
|
||||
|
||||
// Prevent keyboard from appearing automatically on mobile
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user