Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

167
Views
Component that is made for hiding content from screen while still have screen readers read it out is behaving weirdly

I have a very simple component that does two things:

  1. Prevent render of its child components if there is no screen reader enabled
  2. Render its child components if there is a screen reader enabled, but visually hide them from the UI so that they're only visible to the screen reader

The component looks like this:

const VisuallyHidden: FunctionComponent<ViewProps> = ({ ...rest }) => {
    const screenReaderEnabled = useScreenReader();

    if (!screenReaderEnabled) return null;

    return <Hidden {...rest} />;
};

const Hidden = styled(View)`
    position: absolute;
    clip: rect(0 0 0 0);
    overflow: hidden;
    height: 1px;
    width: 1px;
`;

export default VisuallyHidden;

When I try to use the component like this:

<VisuallyHidden>{linkButtons}</VisuallyHidden>

The screen reader does not read out the linkButtons, but when I remove the CSS that hides them from the screen, the screen reader reads them out. So my question is whether my CSS is making the screen reader not read them out for some reason? I know that they are being rendered because I can see them once I remove the CSS that hides them, so the screen reader should be able to reach them.

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!