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

[nextjs-sxa] Image component always wraps <img> tag in an <a> tag, even when TargetUrl field is empty #1593

Closed
Elyseum opened this issue Aug 18, 2023 · 1 comment
Labels

Comments

@Elyseum
Copy link
Contributor

Elyseum commented Aug 18, 2023

Describe the Bug

When rendering an /sitecore/templates/Feature/JSS Experience Accelerator/Media/Image with packages\create-sitecore-jss\src\templates\nextjs-sxa\src\components\Image.tsx, the is always wrapped in an , even when the TargetUrl field (display name URL) is not configured.
This gives users the assumption the image is clickable, which is not the case.

image
image

To Reproduce

Render an /sitecore/templates/Feature/JSS Experience Accelerator/Media/Image with packages\create-sitecore-jss\src\templates\nextjs-sxa\src\components\Image.tsx with TargetURL field left empty.

Expected Behavior

When TargetUrl is empty, the tag should not be wrapped inside an tag.

Possible Fix

No response

Provide environment information

  • Sitecore Version: /
  • JSS Version: dev
  • Browser Name and version: Edge
  • Operating System and version (desktop or mobile): /
  • Link to your project (if available): /
Elyseum pushed a commit to Elyseum/sitecore-jss that referenced this issue Aug 18, 2023
illiakovalenko added a commit that referenced this issue Aug 23, 2023
…argetUrl is not configured (#1594)

* Don't wrap image in link when not configured

* Update CHANGELOG #1593

---------

Co-authored-by: De Vos, Stijn <[email protected]>
Co-authored-by: Illia Kovalenko <[email protected]>
@illiakovalenko
Copy link
Contributor

Close this issue, since PR was merged and fix is provided

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

No branches or pull requests

2 participants