Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: LdModal calls ldmodalclosed event 2 times on single modal close #1164

Open
3 tasks done
ssuchkov opened this issue Feb 25, 2025 · 0 comments
Open
3 tasks done

bug: LdModal calls ldmodalclosed event 2 times on single modal close #1164

ssuchkov opened this issue Feb 25, 2025 · 0 comments
Labels
bug An issue describing unexpected or malicious behaviour. triage An issue that needs assessment to determine its validity and urgency

Comments

@ssuchkov
Copy link

Prerequisites

Liquid version

5.14.0

Framework bindings

React

Current behavior

LdModal calls ldmodalclosed 2 times on modal close.

Expected behavior

LdModal calls ldmodalclosed 1 time on modal close.

Steps to reproduce

code like this reveals is

const modalRef = useRef(null)

return (
  <>
    <LdModal blurryBackdrop ref={modalRef} onLdmodalclosed={() => alert('Modal closed')}>
      <LdTypo style={{ textAlign: 'center' }}>I'm a modal dialog.</LdTypo>
    </LdModal>

    <LdButton onClick={() => modalRef.current.showModal()}>
      Open Modal
    </LdButton>
  </>
)

Code reproduction URL

https://stackblitz.com/edit/github-lmnmdfxu?file=src%2FApp.tsx

Additional information

No response

@ssuchkov ssuchkov added bug An issue describing unexpected or malicious behaviour. triage An issue that needs assessment to determine its validity and urgency labels Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue describing unexpected or malicious behaviour. triage An issue that needs assessment to determine its validity and urgency
Projects
None yet
Development

No branches or pull requests

1 participant