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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<Button> does not show tooltip when disabled #9005

Open
tyteen4a03 opened this issue Nov 4, 2024 · 0 comments · May be fixed by #9006
Open

<Button> does not show tooltip when disabled #9005

tyteen4a03 opened this issue Nov 4, 2024 · 0 comments · May be fixed by #9006
Labels

Comments

@tyteen4a03
Copy link
Contributor

tyteen4a03 commented Nov 4, 2024

Describe the Bug

The <Button> element does not show tooltips when disabled. This is because when a Button is disabled, it does not trigger mouseenter / leave events, which Button uses to listen for tooltip enabling:

onMouseEnter: tooltip ? () => setShowTooltip(true) : undefined,

This can be fixed by changing to use onPointerEnter and onPointerLeave 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

@tyteen4a03 tyteen4a03 added status: needs-triage Possible bug which hasn't been reproduced yet v3 validate-reproduction labels Nov 4, 2024
@tyteen4a03 tyteen4a03 changed the title <Button> does not show toolitip when disabled <Button> does not show tooltip when disabled Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant