mui / mui/base-ui

[tooltip] Trigger does not work when rendering disabled elements

Open
#3,075 3 comments 1 reaction 0 assignees View on GitHub
component: tooltip has workaround
Dominant language
TypeScript
Stars
10.9k
Forks
543
Avg merge
1d 20h
Merged PRs (30d)
101

Description

# Bug report

## Current behavior

Tooltips do not appear when the trigger is wrapped around a disabled button

## Expected behavior

Tooltips should appear

It does not show because `mouseOnly` is true in FloatingUI's [useHover](https://floating-ui.com/docs/usehover#mouseonly) and disabled elements do not fire mouse events. Pointer events do still fire, and setting `mouseOnly` to false or undefined will allow the tooltip to show up (this could also be intentional for accessibility reasons, but [the behavior differs from Radix](https://codesandbox.io/p/sandbox/pedantic-curie-eojbiv?file=%2FApp.js%3A13%2C18))

## Reproducible example

https://stackblitz.com/edit/vitejs-vite-994xiqtx?file=src%2FApp.tsx

## Base UI version

^1.0.0-beta.4

## Which browser are you using?

Chrome

## Which OS are you using?

Mac OS

## Additional context

Provide any additional context that might help us identify the problem and find a solution.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.