An open source design system that's fully customizable and agent ready
TypeScript
fix(core): keep tooltip status button interactive in TextArea trailing slot (#5147)
freddymeta07f999835043
diff --git a/.changeset/textarea-tooltip-status-pointer-events.md b/.changeset/textarea-tooltip-status-pointer-events.mdnew file mode 100644index 0000000000..ec190ba36d--- /dev/null+++ b/.changeset/textarea-tooltip-status-pointer-events.md@@ -0,0 +1,7 @@+---+'@astryxdesign/core': patch+---++[fix] Inputs (`statusVariant="tooltip"`): the focusable status button now opens its tooltip on hover inside `TextArea`, whose absolutely-positioned trailing slot is `pointer-events: none`. Keyboard focus already worked; pointer hover did not.++@freddymetadiff --git a/packages/core/src/hooks/useInputStatusIcon.test.tsx b/packages/core/src/hooks/useInputStatusIcon.test.tsxindex 9923a76b30..883636005a 100644--- a/packages/core/src/hooks/useInputStatusIcon.test.tsx+++ b/packages/core/src/hooks/useInputStatusIcon.test.tsx@@ -159,6 +159,25 @@ describe('useInputStatusIcon — no dangling aria-describedby (WCAG 1.3.1)', ()).not.toBeInTheDocument();expectNoDanglingDescribedBy(container);});++ it('keeps the tooltip status button interactive inside a non-interactive trailing slot', () => {+ // TextArea positions its trailing slot as an absolute overlay with+ // `pointer-events: none` (correct for the decorative spinner/icon it was+ // built for). The focusable status button owns its own interactivity so+ // hover still opens the tooltip there — keyboard focus always worked, the+ // pointer path did not until the button set `pointer-events: auto`.+ render(+ <TextArea+ label="Field"+ value=""+ onChange={() => {}}+ status={{type: 'error', message: 'Message'}}+ statusVariant="tooltip"+ />,+ );+ const statusButton = screen.getByRole('button', {name: 'Error details'});+ expect(statusButton).toHaveStyle({pointerEvents: 'auto'});+ });});describe('useInputStatusIcon — input-status-icon theme target', () => {diff --git a/packages/core/src/hooks/useInputStatusIcon.tsx b/packages/core/src/hooks/useInputStatusIcon.tsxindex 5068730489..844a0741d3 100644--- a/packages/core/src/hooks/useInputStatusIcon.tsx+++ b/packages/core/src/hooks/useInputStatusIcon.tsx@@ -82,6 +82,13 @@ const styles = stylex.create({background: 'none',color: 'inherit',cursor: 'pointer',+ // Own the interactivity so the tooltip opens on hover even when the field+ // renders this affordance inside a non-interactive trailing slot. TextArea+ // positions its end slot as an absolute overlay with `pointer-events: none`+ // (right for the decorative spinner/icon it was built for), which otherwise+ // swallows this button's hover — keyboard focus still worked, pointer did+ // not.+ pointerEvents: 'auto',borderRadius: radiusVars['--radius-full'],// Not the shared offset: this button sits inside the field, and measured at// the standard 3px its ring crosses the field border.