-
Notifications
You must be signed in to change notification settings - Fork 276
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
Link component is not checking if href is undefined #1834
Comments
@deansimcox, thanks for reporting this bug. I will add it to our backlog and prioritize it accordingly. However, if you feel this is a blocker for you, feel free to contribute by issuing a PR to our repository. |
All good, appreciate the update @sc-addypathania |
@sc-addypathania If we PR a fix, would you consider patching it into [email protected]? or v21.x? |
@pzi yes you can issue a fix on the dev branch for now and we will try to prioritize the patch releases soon. |
@sc-addypathania I created a PR of it please review it. |
hey @sumon1991 thanks for your contribution :) I've created an item in our backlog to review and merge your PR |
Describe the Bug
If the field passed to the Link component has an undefined href, it will render undefined as a string in the dom.
To Reproduce
This will render a link like this:
Expected Behavior
I would expect the undefined href to be filtered out, leaving behind an anchor that with no href attribute.
E.g.
Possible Fix
On line 102, we should be checking for undefined
https://github.com/Sitecore/jss/blob/v20.3.3/packages/sitecore-jss-react/src/components/Link.tsx#L102
E.g.
Provide environment information
The text was updated successfully, but these errors were encountered: