mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
94.04k stars 32.31k forks source link

[material-ui][Select] "&ZeroWidthSpace" is being rendered as child element #41515

Open tejasparkar opened 8 months ago

tejasparkar commented 8 months ago

Steps to reproduce

Link to live example: (required)

Steps: 1.Open the url https://mui.com/material-ui/react-select/

  1. Inspect the code in browser
  2. Try navigation with screen reader and observe Capture

Current behavior

https://github.com/mui/material-ui/blob/b57951355a60566aeafc88c9aa49c7f198968b3c/packages/mui-base/src/Select/Select.tsx#L219

<Button {...buttonProps}>
    {renderValue(selectedOptionsMetadata) ?? placeholder ?? (
      // fall back to a zero-width space to prevent layout shift
      // from https://github.com/mui/material-ui/pull/24563
      <span className="notranslate">&#8203;</span>
    )}
  </Button>

No response

Expected behavior

<Button {...buttonProps}>
    {renderValue(selectedOptionsMetadata) ?? placeholder ?? (
      // fall back to a zero-width space to prevent layout shift
      // from https://github.com/mui/material-ui/pull/24563
      <span aria-hidden="true" className="notranslate">&#8203;</span>
    )}
  </Button>

No response

Context

No response

Your environment

npx @mui/envinfo ``` Don't forget to mention which browser you used. Output from `npx @mui/envinfo` goes here. ```

Search keywords: accessibility

maryamabdi76 commented 8 months ago

@mj12albert I can work on this issue.

tejasparkar commented 8 months ago

https://github.com/mui/material-ui/pull/41656

ZeeshanTamboli commented 7 months ago

@tejasparkar What's the problem with the screen reader announcing? What is it announcing incorrectly?

github-actions[bot] commented 6 months ago

Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.

arionkoder-fmazzoni commented 1 month ago

@ZeeshanTamboli sorry to revive this, but the issue is that screen readers are reading the ZeroWidthSpace, tried this on MacOS Chrome with VoiceOver

Can this be reopened or can we try a new pr to fix this a11y issue?

ZeeshanTamboli commented 1 month ago

I'll reopen it but I can't confirm it's an issue. I use Windows OS.

mj12albert commented 1 month ago

Sorry for not getting to this earlier 🙏

I agree aria-hidden is the right solution here

@tejasparkar would you still like to work on this?