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

[Feat]: Expose the event that triggered onModalShow/onModalHide callback function #707

Open
peaemaye opened this issue Jul 15, 2024 · 0 comments
Labels
enhancement New feature or request triage yet to be reviewed

Comments

@peaemaye
Copy link
Contributor

peaemaye commented Jul 15, 2024

Description

When using the onModalShow() callback function it can be useful to know what triggered it. An easy way to achieve this is to expose the event that triggered the callback allowing us to check the event.target or other info.

In may case I wanted to auto-expand a third party services section if it was opened from a static button using: data-cc='show-preferencesModal', but not if it was opened from the button in the standard consent modal.

Proposed solution

See PR #706

Additional details

I've put together a quick StackBlitz to show this in action: https://stackblitz.com/edit/stackblitz-starters-9caf9y?file=index.js

@peaemaye peaemaye added enhancement New feature or request triage yet to be reviewed labels Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage yet to be reviewed
Projects
None yet
Development

No branches or pull requests

1 participant