-
Notifications
You must be signed in to change notification settings - Fork 270
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
Prevent the Angular scLink directive from adding an empty href attribute #380
Comments
@callmeaponte Can you provide me steps, how to setup field - where I'll get empty properties?
|
@callmeaponte I'm always getting such structure, when I try to save link with empty URL: If I added new link field, i got:
I could not get same case, but with empty href, when import jss items, and set externalLink and delete
Which version of Sitecore and JSS are you using? |
@callmeaponte Fixed in #406 . But if you can provide your steps - will be cool |
Thanks @sc-illiakovalenko! Answers to your questions below: "Which version of Sitecore and JSS are you using?" "Can you provide me steps, how to setup field - where I'll get empty properties?" ... Speaking of, would it be too much to ask if you could extend your logic in #406 to treat |
@callmeaponte Thank you, yeah I have also noticed a problem related to |
@callmeaponte I created new one #408 |
Is your feature request related to a problem? Please describe.
The
*scLink
directive adds an href attribute, even if the link data (from the JSS JSON) is empty:This causes a few issues:
To elaborate on point #2 (boilerplate code), the sample JSS JSON above represents a Sitecore content item that lets users specify a heading, and also to (optionally) wrap that heading in a link if they wanted to. Currently, the markup we need to write to support this on the front-end is as follows:
... In contrast, it would be nice to be able to simply write:
Describe the solution you'd like
It would be preferable to omit the attribute instead:
Describe alternatives you've considered
The alternative is to use the boilerplate code displayed above. However this is not ideal, especially when you have to repeat that code for dozens and dozens of link-able elements across your code base.
Additional information
If you approve of this change in behavior then I can open up a PR, just let me know.
The text was updated successfully, but these errors were encountered: