You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to (lazy) load a video in a nextui modal when it opens and pause it when it closes.
When I use the most basic modal example I can find, the onOpenChange event only fires when the modal closes.
When running the most basic example, you will see the onOpenChange only fires when closing the modal:
import{Modal,ModalContent,ModalHeader,ModalBody,ModalFooter,Button,useDisclosure}from"@nextui-org/react";exportdefaultfunctionApp(){const{isOpen, onOpen, onOpenChange}=useDisclosure();return(<><ButtononPress={onOpen}>Open Modal</Button><ModalisOpen={isOpen}onOpenChange={isOpen=>{console.log(isOpen)// only fires on closeonOpenChange()}}><ModalContent>{(onClose)=>(<><ModalHeaderclassName="flex flex-col gap-1">Modal Title</ModalHeader><ModalBody><p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Nullam pulvinar risus non risus hendrerit venenatis.
Pellentesque sit amet hendrerit risus, sed porttitor quam.
</p><p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Nullam pulvinar risus non risus hendrerit venenatis.
Pellentesque sit amet hendrerit risus, sed porttitor quam.
</p><p>
Magna exercitation reprehenderit magna aute tempor cupidatat consequat elit
dolor adipisicing. Mollit dolor eiusmod sunt ex incididunt cillum quis.
Velit duis sit officia eiusmod Lorem aliqua enim laboris do dolor eiusmod.
Et mollit incididunt nisi consectetur esse laborum eiusmod pariatur
proident Lorem eiusmod et. Culpa deserunt nostrud ad veniam.
</p></ModalBody><ModalFooter><Buttoncolor="danger"variant="light"onPress={onClose}>
Close
</Button><Buttoncolor="primary"onPress={onClose}>
Action
</Button></ModalFooter></>)}</ModalContent></Modal></>);}
Expected behavior
I would expect the onOpenChange would also fire when the modal is fully opened and all content is loaded, but it does not?
Screenshots or Videos
No response
Operating System Version
macOS
Browser
Chrome
The text was updated successfully, but these errors were encountered:
NextUI Version
2.4.8
Describe the bug
I'm trying to (lazy) load a video in a nextui modal when it opens and pause it when it closes.
When I use the most basic modal example I can find, the
onOpenChange
event only fires when the modal closes.Your Example Website or App
CodeSandbox
Steps to Reproduce the Bug or Issue
When running the most basic example, you will see the
onOpenChange
only fires when closing the modal:Expected behavior
I would expect the
onOpenChange
would also fire when the modal is fully opened and all content is loaded, but it does not?Screenshots or Videos
No response
Operating System Version
macOS
Browser
Chrome
The text was updated successfully, but these errors were encountered: