Menu
Feedback
Start here

Known issues

Known issues
Open/close modal hook affects all modals on the page
FastStore
ID: 1042165
Backlog
Published on5/31/2024
Last updated on6/4/2024
1 min read

Summary

On opening/closing a modal the action affects all the modals of the page

Simulation

Try opening a modal on a page with more than one Look for the other modals, you'll see the behavior will be the same

Workaround

You can use a customized state instead of the native one. Here is an example:

import { useState } from "react";import { Modal, ModalHeader, ModalBody, LinkButton, Icon } from "@faststore/ui";import ModalContent from "./ModalContent";import section from "./styles.module.scss";const ModalSelector = () => {const [showModal, setShowModal] = useState(false);const ToggleModal = () => {setShowModal((showModal) => !showModal);};return (} > Delivery {showModal && ( <> )});};export default ModalSelector;

Contributors
1
Photo of the contributor
+ 1 contributors
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
1
Photo of the contributor
+ 1 contributors
On this page
Still got questions?
Ask the community
Find solutions and share ideas in the VTEX Community
Join our community
Request VTEX support
For personalized assistance, contact our experts
Open a support ticket
GitHubDeveloper PortalCommunityFeedback