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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tooltip] Tooltip title prop has been changed to aria_label in the rendered component. #30250

Closed
2 tasks done
vladblaj opened this issue Dec 17, 2021 · 2 comments
Closed
2 tasks done
Labels
component: tooltip This is the name of the generic UI component, not the React module! status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it

Comments

@vladblaj
Copy link

vladblaj commented Dec 17, 2021

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 馃槸

Steps:
Passing title prop to Tooltip will actually be transformed to aria_label in the children component. In MUI v4 rendered children components would have the title attribute.

Expected behavior 馃

Children components of Tooltip should have the title prop.

Steps to reproduce 馃暪

Steps:

  1. Go to https://codesandbox.io/s/o4oeq?file=/demo.js (default MUI5 Tooltip example)
  2. Inspect source of React Button Component
  3. Title prop is now aria_label

Context 馃敠

I had a lot of Reacts tests using getByTitle which now fail.

Your environment 馃寧

`npx @mui/envinfo` System: OS: macOS 11.6 Browsers: Chrome: 95.0.4638.69
@vladblaj vladblaj added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 17, 2021
@ahmad-reza619
Copy link
Contributor

ahmad-reza619 commented Dec 18, 2021

You could set the describeChild props to true in your ToolTip component, but I know that's a bit chore. The cause for this is this line https://github.com/mui-org/material-ui/blob/6af5ac9bd062fab467a7ffb3bf67f054b0d5f474/packages/mui-material/src/Tooltip/Tooltip.js#L521

describeChild defaults to false, you can take a look at #22729 for the reason

@vladblaj
Copy link
Author

Hi,
Thanks for the tip, I will make use of describeChild.

@siriwatknp siriwatknp added status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it component: tooltip This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tooltip This is the name of the generic UI component, not the React module! status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it
Projects
None yet
Development

No branches or pull requests

3 participants