mui / mui/material-ui

[joy-ui][Tooltip] Not working with custom sub-components

Open
#42,536 1 comment 0 reactions 1 assignee View on GitHub

@siriwatknp is already working on this.

Since Jun 6, 2024.

on hold package: joy-ui scope: tooltip
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

Steps to reproduce
import {Tooltip} from '@mui/joy';

export function TooltipBug() {
  return <>
    <Tooltip title="foo">
      <div>f</div>
    </Tooltip>
    <Tooltip title="bar">
      <CustomComponent />
    </Tooltip>
  </>;
}

function CustomComponent() {
  return <div>b</div>;
}

shows "foo" but does not show "bar".

Current behavior

Yields:

<div aria-label="foo" class="">f</div>
<div>b</div>
Expected behavior
<div aria-label="foo" class="">f</div>
<div aria-label="bar" class="">b</div>
Context

i want to use components

Your environment

Browser: Mozilla Firefox 126.0.1

npx @mui/envinfo ``` System: OS: Linux 5.19 Manjaro Linux Binaries: Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm pnpm: Not Found Browsers: Chrome: Not Found ```

Search keywords: tooltip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.