Skip to content

Commit 63d1ab5

Browse files
author
Daniel Morse
committed
feat: if inner anchor has no "href", set it using the component's "href" prop
1 parent 5f8f6e3 commit 63d1ab5

File tree

1 file changed

+3
-0
lines changed
  • packages/components/bolt-link/src

1 file changed

+3
-0
lines changed

packages/components/bolt-link/src/link.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ class BoltLink extends withLitHtml() {
188188

189189
if (this.rootElement) {
190190
renderedLink = this.rootElement.firstChild.cloneNode(true);
191+
if (renderedLink.getAttribute('href') === null && hasHref) {
192+
renderedLink.setAttribute('href', this.props.href)
193+
}
191194
renderedLink.className += ' ' + classes;
192195
render(innerSlots, renderedLink);
193196
} else {

0 commit comments

Comments
 (0)