diff --git a/tabs/tab.js b/tabs/tab.js
index ca64a82..f9b045d 100644
--- a/tabs/tab.js
+++ b/tabs/tab.js
@@ -93,25 +93,34 @@ export class Tab extends LitElement {
render() {
const indicator = html`
`
- const content = html`
-
-
-
-
-
-
- ${this.fullWidthIndicator ? nothing : indicator}
-
- ${this.fullWidthIndicator ? indicator : nothing}
- `
return html`
- ${
- this.href
- ? html`
${content}`
- : html`
${content}
`
- }
+
`
}
+
+ renderLink() {
+ const { ariaLabel } = this
+ return html`
+
+ `
+ }
getContentClasses() {
let cc = {
'has-icon': this.hasIcon,
@@ -145,7 +154,7 @@ export class Tab extends LitElement {
// Prevent default behavior such as scrolling when pressing spacebar.
event.preventDefault()
if (this.href) {
- const link = this.renderRoot.querySelector('a.button')
+ const link = this.renderRoot.querySelector('a.link')
link?.click()
} else {
this.click()
@@ -153,6 +162,9 @@ export class Tab extends LitElement {
}
}
handleContentClick(event) {
+ if (this.href) {
+ return
+ }
// Ensure the "click" target is always the tab, and not content, by stopping
// propagation of content clicks and re-clicking the host.
event.stopPropagation()
@@ -247,14 +259,13 @@ export class Tab extends LitElement {
:host([active]) md-focus-ring {
margin-bottom: calc(var(--_active-indicator-height) + 1px);
}
- .button {
- display: inline-flex;
- position: relative;
- align-items: center;
- justify-content: center;
- text-decoration: none;
- color: inherit;
+ .link {
+ position: absolute;
+ inset: 0;
+ width: 100%;
+ height: 100%;
outline: none;
+ z-index: 1;
}
.button::before {
background: var(--_container-color);