Skip to content
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

fix: logo only focusable if href provided #2207

Merged
merged 4 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/components/src/components/telekom/logo/logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class Logo {
<a
href={this.href}
part={this.getCssClassMap()}
tabIndex={this.focusable === false ? -1 : 0}
tabindex={this.focusable === false ? '-1' : '0'}
onFocus={() => {
if (this.scrollIntoViewOnFocus === true) {
window.scrollTo({ top: 0 });
Expand All @@ -96,7 +96,6 @@ export class Logo {
title={this.logoHideTitle ? undefined : this.logoTitle}
aria-describedby={this.logoAriaDescribedBy}
aria-hidden={this.logoAriaHidden}
tabindex={this.logoAriaHidden ? -1 : 0}
>
<scale-logo-svg
part="icon"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

## Properties

| Property | Attribute | Description | Type | Default |
| --------------- | ----------------- | ---------------------------------- | --------- | ----------------------- |
| `logoHideTitle` | `logo-hide-title` | (optional) set logo specific title | `boolean` | `false` |
| `logoHref` | `logo-href` | (optional) Logo link | `string` | `'javascript:void(0);'` |
| `logoTitle` | `logo-title` | (optional) set logo specific title | `string` | `'Telekom Logo'` |
| Property | Attribute | Description | Type | Default |
| --------------- | ----------------- | ---------------------------------- | --------- | ---------------- |
| `logoHideTitle` | `logo-hide-title` | (optional) set logo specific title | `boolean` | `false` |
| `logoHref` | `logo-href` | (optional) Logo link | `string` | `''` |
| `logoTitle` | `logo-title` | (optional) set logo specific title | `string` | `'Telekom Logo'` |


## Shadow Parts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { Component, h, Host, Prop } from '@stencil/core';
})
export class TelekomFooterContent {
/** (optional) Logo link */
@Prop() logoHref?: string = 'javascript:void(0);';
@Prop() logoHref?: string = '';
/** (optional) set logo specific title */
@Prop() logoTitle?: string = 'Telekom Logo';
/** (optional) set logo specific title */
Expand All @@ -42,6 +42,7 @@ export class TelekomFooterContent {
href={this.logoHref}
logoHideTitle={this.logoHideTitle}
logoTitle={this.logoHideTitle ? undefined : this.logoTitle}
focusable={this.logoHref ? true : false}
></scale-logo>
</div>
<div part="body">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export class TelekomHeader {
href={this.logoHref}
logoTitle={this.logoTitle}
logoHideTitle={this.logoHideTitle}
focusable={this.logoHref ? true : false}
></scale-logo>
</slot>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
export default {
name: 'FooterContent',
props: {
logoHref: { type: String, default: 'javascript:void(0);' },
logoHref: { type: String, default: '' },
logoTitle: { type: String, default: 'Telekom Logo' },
logoHideTitle: { type: Boolean, default: false }
}
Expand Down
Loading