You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4a04bef
Browse filesBrowse the repository at this point in the historyBrowse files
[tooltip] Close when the pointer leaves after hovered trigger content is replaced
When the element under the pointer is removed (e.g. an IconButton icon
swapped on hover or open), browsers don't dispatch `mouseout` for it.
Chromium only fires `mouseover` on the new target with the trigger as
`relatedTarget`; WebKit fires it on the document with `relatedTarget:
null`. React derives `onMouseLeave` from `mouseout`, so the trigger
never receives it and the tooltip stays open (the pending enterDelay
timer even opens it after the pointer left).
From the first hover, listen to `mouseover` on the document and
remember the element the pointer was last seen over. A `mouseover` not
handled by the trigger or popper, after that element was removed, means
the pointer left, so run the regular leave path. Events the trigger or
popper handle or deliberately ignore (disabled trigger, touch) are
recorded as handled. No listener is added without a title, and it is
removed on leave, whenever the tooltip closes, when `disableHoverListener`
is enabled or the title is cleared, and on unmount.
Also call `onClose` when the pointer leaves after `onOpen` but before
`open` was updated by a render; previously a controlled tooltip stayed
open in that window. The request is settled by a render after `onOpen`,
so a parent that declines to open does not get an `onClose` later.
Fixesmui#47073
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
0 commit comments