<Button>
does not show tooltip when disabled
#9005
Labels
created-by: Contributor
invalid-reproduction
status: needs-triage
Possible bug which hasn't been reproduced yet
v3
Describe the Bug
The
<Button>
element does not show tooltips when disabled. This is because when a Button is disabled, it does not triggermouseenter / leave
events, whichButton
uses to listen for tooltip enabling:payload/packages/ui/src/elements/Button/index.tsx
Line 117 in 3583c45
This can be fixed by changing to use
onPointerEnter
andonPointerLeave
to listen to enter/exit events.Ref: https://stackoverflow.com/questions/18113937/fire-onmouseover-event-when-element-is-disabled
Link to the code that reproduces this issue
N/A
Reproduction Steps
Render this element:
<Button disabled={true} tooltip="I will not show" />
Which area(s) are affected? (Select all that apply)
area: ui
Environment Info
Node.js v22.10.0
Binaries:
Node: 22.10.0
npm: 10.9.0
Yarn: N/A
pnpm: 9.12.1
Relevant Packages:
payload: 3.0.0-beta.123
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:03:15 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6000
Available memory (MB): 32768
Available CPU cores: 10
The text was updated successfully, but these errors were encountered: