Skip to content

Commit

Permalink
refactor(link): don't conflate JSX tag name and string
Browse files Browse the repository at this point in the history
`Tag` and `childElType` are the same in Stencil, but will be different
in Lit - so we should use `childElType` in places where the string check
is needed.
  • Loading branch information
maxpatiiuk committed Sep 24, 2024
1 parent 9e64d87 commit 5696e22
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/calcite-components/src/components/link/link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,19 @@ export class Link implements InteractiveComponent, LoadableComponent {
This works around that issue for now.
*/
download={
Tag === "a" ? (download === true || download === "" ? "" : download || null) : null
childElType === "a"
? download === true || download === ""
? ""
: download || null
: null
}
href={Tag === "a" && this.href}
href={childElType === "a" && this.href}
onClick={this.childElClickHandler}
ref={this.storeTagRef}
rel={Tag === "a" && this.rel}
rel={childElType === "a" && this.rel}
role={role}
tabIndex={tabIndex}
target={Tag === "a" && this.target}
target={childElType === "a" && this.target}
>
{this.iconStart ? iconStartEl : null}
<slot />
Expand Down

0 comments on commit 5696e22

Please sign in to comment.