fix: allow tooltips in disabled button labels - #10899
wardkadan1 wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
Verification results:
|
|
Verification evidence for this PR: Unit tests: Result:
Playwright E2E: Result:
The #2515 browser test verifies:
Lint: Result:
Also, the complete enabled-state unit test ends with these assertions:
The displayed diff appears to be truncated by the evaluator, but the complete focused unit-test file runs successfully with 2/2 tests passing. |
This pull request was authored by a coding agent.
Fixes #2515.
Problem
A disabled
mo.ui.buttonappliespointer-events: none, which preventsdata-tooltipelements inside its label from receiving the pointer eventsneeded to open the tooltip.
This means a tooltip explaining why a button is disabled cannot be shown.
Fix
The change is scoped to
ButtonPlugin.For disabled buttons, the rendered label is wrapped in a layout-neutral
display: contentselement withpointer-events: auto.This restores pointer events to the label subtree while preserving the native
disabledstate of the button.Enabled buttons are unchanged.
Verification
Unit test
pnpm exec vitest run src/plugins/impl/__tests__/ButtonPlugin.test.tsx