Skip to content

Commit

Permalink
Merge pull request #12285 from bbc/WSTEAMA-1115-ally-fix-focus-indica…
Browse files Browse the repository at this point in the history
…tor-on-homepage-promos

WSTEAMA-1115 - A11y | Fix focus indicator VoiceOver bug on Homepage promos
  • Loading branch information
louisearchibald authored Jan 21, 2025
2 parents 3b94cf0 + 9a5772b commit 5866586
Show file tree
Hide file tree
Showing 12 changed files with 156 additions and 171 deletions.
1 change: 1 addition & 0 deletions src/app/components/Billboard/index.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export default {
link: ({ palette }: Theme) =>
css({
textDecoration: 'none',
display: 'block',
color: palette.WHITE,
cursor: 'pointer',
'&:hover, &:focus': {
Expand Down
7 changes: 1 addition & 6 deletions src/app/components/Billboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,7 @@ const Billboard = forwardRef(
/>
<div css={styles.textContainer}>
<Heading level={2} size="paragon" css={styles.heading} id={id}>
<a
href={link}
css={styles.link}
className="focusIndicatorDisplayBlock"
onClick={clickTrackerHandler}
>
<a href={link} css={styles.link} onClick={clickTrackerHandler}>
{showLiveLabel ? (
<div data-testid="billboard-live-label">
<LivePulse
Expand Down
8 changes: 2 additions & 6 deletions src/app/components/Curation/CurationPromo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@ const CurationPromo = ({
</Promo.Image>
<Promo.Heading as={`h${headingLevel}`}>
{isMedia ? (
<Promo.A
href={link}
aria-labelledby={id}
className="focusIndicatorDisplayBlock"
>
<Promo.A href={link} aria-labelledby={id}>
<span id={id} role="text">
<VisuallyHiddenText data-testid="visually-hidden-text">
{typeTranslated}
Expand All @@ -71,7 +67,7 @@ const CurationPromo = ({
</span>
</Promo.A>
) : (
<Promo.A href={link} className="focusIndicatorDisplayBlock">
<Promo.A href={link}>
{isLive ? <LiveLabel>{title}</LiveLabel> : title}
</Promo.A>
)}
Expand Down
11 changes: 2 additions & 9 deletions src/app/components/Curation/HierarchicalGrid/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,7 @@ const HiearchicalGrid = ({
})}
>
{isMedia ? (
<Promo.A
href={promo.link}
aria-labelledby={promo.id}
className="focusIndicatorDisplayBlock"
>
<Promo.A href={promo.link} aria-labelledby={promo.id}>
<span id={promo.id} role="text">
<VisuallyHiddenText data-testid="visually-hidden-text">
{typeTranslated}
Expand All @@ -125,10 +121,7 @@ const HiearchicalGrid = ({
</span>
</Promo.A>
) : (
<Promo.A
href={promo.link}
className="focusIndicatorDisplayBlock"
>
<Promo.A href={promo.link}>
{isLive ? (
<LiveLabel
{...(isFirstPromo && {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ exports[`AmpMostRead should render as expected 1`] = `
color: #222222;
-webkit-text-decoration: none;
text-decoration: none;
margin-bottom: 0.5rem;
display: inline-block;
}
@media (min-width: 20rem) and (max-width: 37.4375rem) {
Expand Down Expand Up @@ -265,7 +265,7 @@ exports[`AmpMostRead should render as expected 1`] = `
dir="ltr"
>
<a
class="focusIndicatorDisplayTableCell emotion-7"
class="emotion-7"
href="{{href}}"
>
{{title}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ exports[`MostReadItemWrapper should render ltr correctly with 10 items 1`] = `
color: #222222;
-webkit-text-decoration: none;
text-decoration: none;
margin-bottom: 0.5rem;
display: inline-block;
}
@media (min-width: 20rem) and (max-width: 37.4375rem) {
Expand Down Expand Up @@ -508,7 +508,7 @@ exports[`MostReadItemWrapper should render ltr correctly with 10 items 1`] = `
dir="ltr"
>
<a
class="focusIndicatorDisplayTableCell emotion-6"
class="emotion-6"
href="https://www.bbc.com/pidgin/articles/cwl08rd38l6o"
>
Tins you need to know about Babcock University
Expand Down Expand Up @@ -539,7 +539,7 @@ exports[`MostReadItemWrapper should render ltr correctly with 10 items 1`] = `
dir="ltr"
>
<a
class="focusIndicatorDisplayTableCell emotion-6"
class="emotion-6"
href="https://www.bbc.com/pidgin/articles/cwl08rd38l6o"
>
Tins you need to know about Babcock University
Expand Down Expand Up @@ -570,7 +570,7 @@ exports[`MostReadItemWrapper should render ltr correctly with 10 items 1`] = `
dir="ltr"
>
<a
class="focusIndicatorDisplayTableCell emotion-6"
class="emotion-6"
href="https://www.bbc.com/pidgin/articles/cwl08rd38l6o"
>
Tins you need to know about Babcock University
Expand Down Expand Up @@ -601,7 +601,7 @@ exports[`MostReadItemWrapper should render ltr correctly with 10 items 1`] = `
dir="ltr"
>
<a
class="focusIndicatorDisplayTableCell emotion-6"
class="emotion-6"
href="https://www.bbc.com/pidgin/articles/cwl08rd38l6o"
>
Tins you need to know about Babcock University
Expand Down Expand Up @@ -632,7 +632,7 @@ exports[`MostReadItemWrapper should render ltr correctly with 10 items 1`] = `
dir="ltr"
>
<a
class="focusIndicatorDisplayTableCell emotion-6"
class="emotion-6"
href="https://www.bbc.com/pidgin/articles/cwl08rd38l6o"
>
Tins you need to know about Babcock University
Expand Down Expand Up @@ -663,7 +663,7 @@ exports[`MostReadItemWrapper should render ltr correctly with 10 items 1`] = `
dir="ltr"
>
<a
class="focusIndicatorDisplayTableCell emotion-6"
class="emotion-6"
href="https://www.bbc.com/pidgin/articles/cwl08rd38l6o"
>
Tins you need to know about Babcock University
Expand Down Expand Up @@ -694,7 +694,7 @@ exports[`MostReadItemWrapper should render ltr correctly with 10 items 1`] = `
dir="ltr"
>
<a
class="focusIndicatorDisplayTableCell emotion-6"
class="emotion-6"
href="https://www.bbc.com/pidgin/articles/cwl08rd38l6o"
>
Tins you need to know about Babcock University
Expand Down Expand Up @@ -725,7 +725,7 @@ exports[`MostReadItemWrapper should render ltr correctly with 10 items 1`] = `
dir="ltr"
>
<a
class="focusIndicatorDisplayTableCell emotion-6"
class="emotion-6"
href="https://www.bbc.com/pidgin/articles/cwl08rd38l6o"
>
Tins you need to know about Babcock University
Expand Down Expand Up @@ -756,7 +756,7 @@ exports[`MostReadItemWrapper should render ltr correctly with 10 items 1`] = `
dir="ltr"
>
<a
class="focusIndicatorDisplayTableCell emotion-6"
class="emotion-6"
href="https://www.bbc.com/pidgin/articles/cwl08rd38l6o"
>
Tins you need to know about Babcock University
Expand Down Expand Up @@ -787,7 +787,7 @@ exports[`MostReadItemWrapper should render ltr correctly with 10 items 1`] = `
dir="ltr"
>
<a
class="focusIndicatorDisplayTableCell emotion-6"
class="emotion-6"
href="https://www.bbc.com/pidgin/articles/cwl08rd38l6o"
>
Tins you need to know about Babcock University
Expand Down Expand Up @@ -1006,7 +1006,7 @@ exports[`MostReadItemWrapper should render rtl correctly with 10 items 1`] = `
color: #222222;
-webkit-text-decoration: none;
text-decoration: none;
margin-bottom: 0.5rem;
display: inline-block;
}
@media (min-width: 20rem) and (max-width: 37.4375rem) {
Expand Down Expand Up @@ -1306,7 +1306,7 @@ exports[`MostReadItemWrapper should render rtl correctly with 10 items 1`] = `
dir="rtl"
>
<a
class="focusIndicatorDisplayTableCell emotion-6"
class="emotion-6"
href="https://www.bbc.com/persian/articles/cej3lzd5e0go"
>
در این جشنواره برای نخستین بار از کارگران افغانستان در شهر تهران تقدیر شد
Expand Down Expand Up @@ -1337,7 +1337,7 @@ exports[`MostReadItemWrapper should render rtl correctly with 10 items 1`] = `
dir="rtl"
>
<a
class="focusIndicatorDisplayTableCell emotion-6"
class="emotion-6"
href="https://www.bbc.com/persian/articles/cej3lzd5e0go"
>
در این جشنواره برای نخستین بار از کارگران افغانستان در شهر تهران تقدیر شد
Expand Down Expand Up @@ -1368,7 +1368,7 @@ exports[`MostReadItemWrapper should render rtl correctly with 10 items 1`] = `
dir="rtl"
>
<a
class="focusIndicatorDisplayTableCell emotion-6"
class="emotion-6"
href="https://www.bbc.com/persian/articles/cej3lzd5e0go"
>
در این جشنواره برای نخستین بار از کارگران افغانستان در شهر تهران تقدیر شد
Expand Down Expand Up @@ -1399,7 +1399,7 @@ exports[`MostReadItemWrapper should render rtl correctly with 10 items 1`] = `
dir="rtl"
>
<a
class="focusIndicatorDisplayTableCell emotion-6"
class="emotion-6"
href="https://www.bbc.com/persian/articles/cej3lzd5e0go"
>
در این جشنواره برای نخستین بار از کارگران افغانستان در شهر تهران تقدیر شد
Expand Down Expand Up @@ -1430,7 +1430,7 @@ exports[`MostReadItemWrapper should render rtl correctly with 10 items 1`] = `
dir="rtl"
>
<a
class="focusIndicatorDisplayTableCell emotion-6"
class="emotion-6"
href="https://www.bbc.com/persian/articles/cej3lzd5e0go"
>
در این جشنواره برای نخستین بار از کارگران افغانستان در شهر تهران تقدیر شد
Expand Down Expand Up @@ -1461,7 +1461,7 @@ exports[`MostReadItemWrapper should render rtl correctly with 10 items 1`] = `
dir="rtl"
>
<a
class="focusIndicatorDisplayTableCell emotion-6"
class="emotion-6"
href="https://www.bbc.com/persian/articles/cej3lzd5e0go"
>
در این جشنواره برای نخستین بار از کارگران افغانستان در شهر تهران تقدیر شد
Expand Down Expand Up @@ -1492,7 +1492,7 @@ exports[`MostReadItemWrapper should render rtl correctly with 10 items 1`] = `
dir="rtl"
>
<a
class="focusIndicatorDisplayTableCell emotion-6"
class="emotion-6"
href="https://www.bbc.com/persian/articles/cej3lzd5e0go"
>
در این جشنواره برای نخستین بار از کارگران افغانستان در شهر تهران تقدیر شد
Expand Down Expand Up @@ -1523,7 +1523,7 @@ exports[`MostReadItemWrapper should render rtl correctly with 10 items 1`] = `
dir="rtl"
>
<a
class="focusIndicatorDisplayTableCell emotion-6"
class="emotion-6"
href="https://www.bbc.com/persian/articles/cej3lzd5e0go"
>
در این جشنواره برای نخستین بار از کارگران افغانستان در شهر تهران تقدیر شد
Expand Down Expand Up @@ -1554,7 +1554,7 @@ exports[`MostReadItemWrapper should render rtl correctly with 10 items 1`] = `
dir="rtl"
>
<a
class="focusIndicatorDisplayTableCell emotion-6"
class="emotion-6"
href="https://www.bbc.com/persian/articles/cej3lzd5e0go"
>
در این جشنواره برای نخستین بار از کارگران افغانستان در شهر تهران تقدیر شد
Expand Down Expand Up @@ -1585,7 +1585,7 @@ exports[`MostReadItemWrapper should render rtl correctly with 10 items 1`] = `
dir="rtl"
>
<a
class="focusIndicatorDisplayTableCell emotion-6"
class="emotion-6"
href="https://www.bbc.com/persian/articles/cej3lzd5e0go"
>
در این جشنواره برای نخستین بار از کارگران افغانستان در شهر تهران تقدیر شد
Expand Down Expand Up @@ -1619,7 +1619,7 @@ exports[`MostReadLink should render ltr correctly 1`] = `
color: #222222;
-webkit-text-decoration: none;
text-decoration: none;
margin-bottom: 0.5rem;
display: inline-block;
}
@media (min-width: 20rem) and (max-width: 37.4375rem) {
Expand Down Expand Up @@ -1681,7 +1681,7 @@ exports[`MostReadLink should render ltr correctly 1`] = `
dir="ltr"
>
<a
class="focusIndicatorDisplayTableCell emotion-1"
class="emotion-1"
href="https://www.bbc.com/pidgin/articles/cwl08rd38l6o"
>
Tins you need to know about Babcock University
Expand Down Expand Up @@ -1713,7 +1713,7 @@ exports[`MostReadLink should render rtl correctly 1`] = `
color: #222222;
-webkit-text-decoration: none;
text-decoration: none;
margin-bottom: 0.5rem;
display: inline-block;
}
@media (min-width: 20rem) and (max-width: 37.4375rem) {
Expand Down Expand Up @@ -1775,7 +1775,7 @@ exports[`MostReadLink should render rtl correctly 1`] = `
dir="rtl"
>
<a
class="focusIndicatorDisplayTableCell emotion-1"
class="emotion-1"
href="https://www.bbc.com/persian/articles/cej3lzd5e0go"
>
در این جشنواره برای نخستین بار از کارگران افغانستان در شهر تهران تقدیر شد
Expand Down Expand Up @@ -1807,7 +1807,7 @@ exports[`MostReadLink should render with last updated date correctly 1`] = `
color: #222222;
-webkit-text-decoration: none;
text-decoration: none;
margin-bottom: 0.5rem;
display: inline-block;
}
@media (min-width: 20rem) and (max-width: 37.4375rem) {
Expand Down Expand Up @@ -1897,7 +1897,7 @@ exports[`MostReadLink should render with last updated date correctly 1`] = `
dir="ltr"
>
<a
class="focusIndicatorDisplayTableCell emotion-1"
class="emotion-1"
href="https://www.bbc.com/pidgin/articles/cwl08rd38l6o"
>
Tins you need to know about Babcock University
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/MostRead/Canonical/Item/index.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { css, Theme } from '@emotion/react';
import { grid } from '../../../../legacy/psammead/psammead-styles/src/detection';

const styles = {
link: ({ spacings, palette, fontSizes, fontVariants }: Theme) =>
link: ({ palette, fontSizes, fontVariants }: Theme) =>
css({
...fontSizes.pica,
...fontVariants.serifMedium,

position: 'static',
color: palette.EBON,
textDecoration: 'none',
marginBottom: `${spacings.FULL}rem`,
display: 'inline-block',

'&:hover, &:focus': {
textDecoration: 'underline',
Expand Down
1 change: 0 additions & 1 deletion src/app/components/MostRead/Canonical/Item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export const MostReadLink = ({
css={[styles.link, size === 'default' && styles.defaultLink]}
href={href}
onClick={clickTrackerHandler}
className="focusIndicatorDisplayTableCell"
>
{title}
</a>
Expand Down
Loading

0 comments on commit 5866586

Please sign in to comment.