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

CTA doen't work with javascript&colon;alert('message'); as works with tel:<tel number> #2904

Open
bhavigoyal2000 opened this issue Dec 28, 2024 · 0 comments

Comments

@bhavigoyal2000
Copy link

Bug Report

Current Behavior
In teaser Component currently if we provide tel: in CTA it works fine and open up the available phone caller app but when adding javascript:alert('message'); to the CTA it doesn't open up the alert Box.

Expected behavior/code
When adding javascript:alert('message'); to the CTA it should open up the alet box.

Environment

  • AEM 6.5.21, AEMaaCS
  • Core Components version 2.27.0
  • JRE version - Java(TM) SE Runtime Environment 11

Possible Solution
We can overwrite the href element with the proper context. Like this:
In action.html, Explicitly add the href element after the data-sly-attributes.

Additional context / Screenshots
teaser-CTA
Result
CTA-1
CTA-2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant