Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

fix(Thumbnail): Open and Remove stay mounted while they cannot act (#8542)

Cindy Zhangbb12cfbd6063
diff --git a/.changeset/thumbnail-actions-stay-mounted.md b/.changeset/thumbnail-actions-stay-mounted.md
new file mode 100644
index 0000000000..c9c38bab9b
--- /dev/null
+++ b/.changeset/thumbnail-actions-stay-mounted.md
@@ -0,0 +1,7 @@
+---
+'@astryxdesign/core': patch
+---
+
+[fix] Thumbnail: Open and Remove stay mounted while they cannot act. A loading or disabled thumbnail keeps Open, and a disabled one keeps Remove, focusable and announced as disabled instead of removing them, so keyboard focus on an action no longer falls to the page body when the thumbnail starts loading or becomes disabled.
+
+@cixzhang
diff --git a/.changeset/thumbnail-disabled-block-doc.md b/.changeset/thumbnail-disabled-block-doc.md
new file mode 100644
index 0000000000..7255c7d69c
--- /dev/null
+++ b/.changeset/thumbnail-disabled-block-doc.md
@@ -0,0 +1,7 @@
+---
+'@astryxdesign/cli': patch
+---
+
+[docs] Thumbnail — Disabled block: its description no longer says the remove button and click handler are suppressed; a disabled thumbnail's open and remove buttons stay focusable and announced as disabled, and call nothing.
+
+@cixzhang
diff --git a/packages/cli/assets/templates/blocks/components/Thumbnail/ThumbnailDisabled.doc.mjs b/packages/cli/assets/templates/blocks/components/Thumbnail/ThumbnailDisabled.doc.mjs
index fda328483b..857a1abc2a 100644
--- a/packages/cli/assets/templates/blocks/components/Thumbnail/ThumbnailDisabled.doc.mjs
+++ b/packages/cli/assets/templates/blocks/components/Thumbnail/ThumbnailDisabled.doc.mjs
@@ -6,7 +6,7 @@ export const doc = {
exampleFor: 'Thumbnail',
name: 'Thumbnail — Disabled',
displayName: 'Thumbnail — Disabled',
- description: 'Thumbnails in the disabled state with reduced opacity. The remove button and click handler are suppressed when disabled.',
+ description: 'Thumbnails in the disabled state with reduced opacity. The open and remove buttons stay focusable and announced as disabled, and call nothing.',
isReady: true,
aspectRatio: 16 / 9,
componentsUsed: ['Thumbnail', 'Layout', 'Text'],
diff --git a/packages/core/src/Thumbnail/Thumbnail.spec.md b/packages/core/src/Thumbnail/Thumbnail.spec.md
index 19eaa0ed1a..6546fd3469 100644
--- a/packages/core/src/Thumbnail/Thumbnail.spec.md
+++ b/packages/core/src/Thumbnail/Thumbnail.spec.md
@@ -41,7 +41,7 @@ system_specs: [spec:AST-009, spec:AST-085, spec:AST-086]
| Behavior | The preview shows a skeleton, the image, an upload overlay, or a placeholder; it is a named group whose open and remove actions are separate buttons. |
| End-user impact | Screen-reader users hear the file and image in one group name and reach "Open …" and "Remove …" buttons; keyboard and touch users can always reach a hover-revealed remove button. |
| Builder impact | None; the record describes shipped behavior. |
-| Compatibility/readiness | Released behavior recorded as current; no API, default, or output changes. Eight implementation gaps are listed under Current-state impact. |
+| Compatibility/readiness | Released behavior recorded as current; no API, default, or output changes. Six implementation gaps are listed under Current-state impact. |
| Review checks | Reject a hover-only remove button that leaves the tab order, a name on a roleless element, an image exposed without `alt`, or a busy spinner that announces itself. |
| Governing rules | `spec:AST-085/FR1`; `spec:AST-086/FR8`; WCAG 2.2 2.5.8; `architecture:public-component-api/INV5,INV6,INV8`; `architecture:internationalization/INV1a`. |
@@ -89,14 +89,6 @@ Consumer migration instructions belong in consumer docs and release notes.
focus move.
- **Disabled state not reflected on the target (FR6).** The `thumbnail`
target reflects no state, so a theme cannot style the disabled state there (`architecture:component-theming-surface` INV6).
-- **Disabled removes the actions (FR6, AR5).** `isDisabled` stops rendering the
- open and remove buttons, so they leave the tab order and expose no disabled
- state, where `spec:AST-085` FR1 and FR5 keep a disabled control focusable and
- announced.
-- **Focus lost when an action unmounts (FR4–FR6).** Setting `isDisabled`, or
- `isLoading` for the open button, unmounts a focused action and focus falls to
- the page body, where `spec:AST-085` FR1, FR4, and FR6 keep the control
- mounted and inert so focus stays put.
## Ownership boundary
@@ -136,9 +128,9 @@ Consumer migration instructions belong in consumer docs and release notes.
| FR1 | The root is a 64px-wide, non-shrinking, isolated inline-flex column carrying the `thumbnail` target. It holds a square image container with `--radius-element` corners, clipped overflow, and a `--color-neutral` background. | Current source and tests |
| FR2 | `isLoading` without `src` shows a Skeleton; `isLoading` with `src` shows the image, or the placeholder glyph if that `src` failed, under an overlay-colored upload scrim holding a small on-media Spinner; `src` without loading shows the image, cover-fitted, with a 1px inset border; no `src`, or a `src` that failed to load, shows a secondary-colored image placeholder glyph. A failure is tracked per `src`, so a changed `src` is tried again. | Current source and tests |
| FR3 | The root is `role="group"` named "{label} — {alt}" when both exist, else `label`, else `alt`, else the translated "Thumbnail"; a caller `aria-label` or `aria-labelledby` reaches the root after it and names the group instead. A joined name is one catalog message (`architecture:internationalization` INV1a); implementation gap: "{label} — {alt}" is joined at the call site (Current-state impact). A defined `label` also wraps the thumbnail in a Tooltip showing it, which also sets the label as the group's accessible description; `label` is never rendered inline. A tooltip can be revealed from the keyboard (WCAG 2.2 2.1.1). Implementation gap: the tooltip attaches to the non-focusable root and opens on hover and touch only; focusing the open or remove button does not show it (Current-state impact). In development, a `src` with no `alt`, `label`, `aria-label`, or `aria-labelledby` logs a warning. | Current source and tests |
-| FR4 | With `onClick`, a full-size `button type="button"` named "Open {name}" wraps the image content and calls `onClick`; hover and pressed overlays show for mouse and touch. While loading or disabled, Open stays mounted and inert, so a focused Open keeps focus (`spec:AST-085` FR1, FR4, FR6). Each focus move shows one indicator (`architecture:interaction-modality` INV3): the image container draws the shared focus-visible outline for the open button. Implementation gaps: Open is not rendered while loading or disabled, so a focused Open is unmounted and focus falls to the page body; and both the open and the remove button keep their own focus ring inside the container outline, so focusing either draws two indicators (Current-state impact). | Current source and tests |
-| FR5 | With `onRemove`, a small icon-only secondary Button named "Remove {name}" sits `--spacing-1` from the top and inline-end edges above the image, painted with the overlay scrim and on-dark icon; a click stops propagation before `onRemove`, so it never opens the thumbnail. With `showRemoveOn="hover"` the button is visually hidden at rest by opacity, stays in the tab order and accessibility tree, and is revealed on container hover, on focus within, and always on touch devices. While disabled, Remove stays mounted and inert, so a focused Remove keeps focus (`spec:AST-085` FR1, FR4); implementation gap: it is not rendered while disabled (Current-state impact). | Current source and tests |
-| FR6 | `isDisabled` dims the root to half opacity with pointer events off. Its actions stay mounted, focusable, and announced as disabled (`spec:AST-085` FR1, FR4, FR5), and the disabled state is reflected on the owning target (`architecture:component-theming-surface` INV6). Implementation gap: a disabled thumbnail renders neither the open nor the remove button, and the `thumbnail` target reflects no state (Current-state impact). | Current source and tests |
+| FR4 | With `onClick`, a full-size `button type="button"` named "Open {name}" wraps the image content and calls `onClick`; hover and pressed overlays show for mouse and touch. While loading or disabled, Open stays mounted and inert, so a focused Open keeps focus (`spec:AST-085` FR1, FR4, FR6). Each focus move shows one indicator (`architecture:interaction-modality` INV3): the image container draws the shared focus-visible outline for the open button. Implementation gap: both the open and the remove button keep their own focus ring inside the container outline, so focusing either draws two indicators (Current-state impact). | Current source and tests |
+| FR5 | With `onRemove`, a small icon-only secondary Button named "Remove {name}" sits `--spacing-1` from the top and inline-end edges above the image, painted with the overlay scrim and on-dark icon; a click stops propagation before `onRemove`, so it never opens the thumbnail. With `showRemoveOn="hover"` the button is visually hidden at rest by opacity, stays in the tab order and accessibility tree, and is revealed on container hover, on focus within, and always on touch devices. While disabled, Remove stays mounted and inert, so a focused Remove keeps focus (`spec:AST-085` FR1, FR4). | Current source and tests |
+| FR6 | `isDisabled` dims the root to half opacity with pointer events off. Its actions stay mounted, focusable, and announced as disabled (`spec:AST-085` FR1, FR4, FR5), and the disabled state is reflected on the owning target (`architecture:component-theming-surface` INV6). Implementation gap: the `thumbnail` target reflects no state (Current-state impact). | Current source and tests |
| FR7 | `ref` reaches the root. Supported DOM, ARIA, data, and event props reach the root; `data-testid` reaches the root; `xstyle`, `className`, and `style` merge in that order after component styles. A caller `aria-label` or `aria-labelledby` names the group (FR3). The group role is component-owned semantics (`architecture:public-component-api` INV5). Implementation gap: caller props spread after the role, so a caller `role` replaces it (Current-state impact). | Current source and tests |
### Allowed variation
@@ -150,16 +142,16 @@ Consumer migration instructions belong in consumer docs and release notes.
### Representative states
-| State | Required invariant | Allowed variation |
-| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- |
-| Image, named | Group named from `label` and `alt`; image exposed with its `alt`. | — |
-| Image without alt | Image `alt=""`, `role="presentation"`, `aria-hidden`. | — |
-| Placeholder or error | Placeholder glyph; a new `src` retries. | — |
-| Loading, no src | Skeleton; an Open action stays mounted and inert (today it is not rendered, the FR4 gap). | — |
-| Uploading | The image, or the placeholder if it failed, under the scrim with a hidden Spinner; busy start announced once; an Open action stays mounted and inert (today it is not rendered, the FR4 gap). | — |
-| Openable | "Open {name}" button; focus outline on the container (the button's own ring is the FR4 gap). | — |
-| Removable, hover | "Remove {name}" in the tab order, revealed on hover, focus, and touch. | — |
-| Disabled | Half opacity; Open and Remove stay mounted, focusable, and inert (today neither renders, the FR6 gap). | — |
+| State | Required invariant | Allowed variation |
+| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- |
+| Image, named | Group named from `label` and `alt`; image exposed with its `alt`. | — |
+| Image without alt | Image `alt=""`, `role="presentation"`, `aria-hidden`. | — |
+| Placeholder or error | Placeholder glyph; a new `src` retries. | — |
+| Loading, no src | Skeleton; an Open action stays mounted and inert. | — |
+| Uploading | The image, or the placeholder if it failed, under the scrim with a hidden Spinner; busy start announced once; an Open action stays mounted and inert. | — |
+| Openable | "Open {name}" button; focus outline on the container (the button's own ring is the FR4 gap). | — |
+| Removable, hover | "Remove {name}" in the tab order, revealed on hover, focus, and touch. | — |
+| Disabled | Half opacity; Open and Remove stay mounted, focusable, and inert. | — |
### Transformation and precedence order
@@ -195,8 +187,7 @@ Consumer migration instructions belong in consumer docs and release notes.
- **AR5 — Disabled and loading.** A disabled thumbnail's actions stay mounted,
focusable, and announced as disabled, and a loading thumbnail's Open stays
mounted and inert, so focus never moves when either state starts
- (`spec:AST-085` FR1, FR4, FR5, FR6). Implementation gap: those actions are
- not rendered in those states.
+ (`spec:AST-085` FR1, FR4, FR5, FR6).
- **AR6 — Reachable remove.** A hover-revealed remove button is never removed
from the tab order and appears on keyboard focus and on touch devices.
@@ -216,7 +207,7 @@ declared.
## Family and system relationships
-- `spec:AST-085` owns focusable disabled controls; AR5 records Thumbnail's gap.
+- `spec:AST-085` owns focusable disabled controls; AR5 records how Thumbnail applies it.
- `spec:AST-086` owns busy announcements; AR3 records Thumbnail's conformance.
- `architecture:internationalization` owns the catalog behind the fallback
name and the open and remove names.
@@ -230,9 +221,9 @@ declared.
| FR1 | `Thumbnail.stories.tsx` in a browser | Every state | Gap: no test asserts the root width, layout, or the image container's shape, clipping, or paint; they are visible only in the rendered fixture. | `audit:Thumbnail/layout` |
| FR2, ORD1 | `Thumbnail.test.tsx` state, error, and retry tests | Image, placeholder, skeleton, uploading, failed, changed `src` | A wrong element for any state, a failed image left showing, or a changed `src` not retried fails. Gap: a failed `src` while uploading, the scrim and placeholder paint and the Spinner's size and shade have no automated check; the cover fit and inset border appear only in the static-image visual baseline. | `audit:Thumbnail/behavior` |
| FR3, ORD2, AR1, AR2 | `Thumbnail.test.tsx` naming, role, image, warning, and tooltip tests | Label, label with alt, alt, neither | A missing label or joined name, a missing `group` role, an exposed decorative image, a lost `alt`, a missing or repeated warning, or the label rendered inline fails. Gap: no test asserts the alt-only or default "Thumbnail" name, a caller `aria-label` or `aria-labelledby`, the label description, or the tooltip opening. | `audit:Thumbnail/a11y` |
-| FR4 | `Thumbnail.test.tsx` naming, click, loading, disabled, and touch-press tests | Openable, loading, disabled | A wrong "Open …" name, a lost callback, or a missing touch-press overlay fails. The loading and disabled tests assert that Open is absent, which is the recorded gap. Gap: the full-size button, the hover overlay, the focus indicators, and Open staying mounted and inert have no automated check. | `audit:Thumbnail/behavior` |
+| FR4 | `Thumbnail.test.tsx` naming, click, loading, disabled, and touch-press tests | Openable, loading, disabled | A wrong "Open …" name, a lost callback, or a missing touch-press overlay fails. The loading and disabled tests fail if Open unmounts, calls `onClick`, or loses focus or its disabled state. Gap: the full-size button, the hover overlay, and the focus indicators have no automated check. | `audit:Thumbnail/behavior` |
| FR5, ORD3, AR6 | `Thumbnail.test.tsx` remove and `showRemoveOn` suites | Hover, always, default reveal | A lost `onRemove`, a hover-revealed button missing from the DOM, or the same reveal treatment for both values fails. A wrong "Remove …" name also fails. Gap: that a remove click never calls `onClick`, the button's position and paint, and the reveal triggers have no automated check. | `audit:Thumbnail/a11y` |
-| FR6, AR5 | `Thumbnail.test.tsx` disabled tests | Disabled with actions | The tests assert the actions are absent, which is the recorded gap. Gap: the half opacity and pointer-events rule have no automated check. | `audit:Thumbnail/a11y` |
+| FR6, AR5 | `Thumbnail.test.tsx` disabled tests | Disabled with actions | The tests fail if a disabled Open or Remove unmounts, loses focus, drops `aria-disabled`, or calls its callback. Gap: the half opacity and pointer-events rule have no automated check. | `audit:Thumbnail/a11y` |
| FR7 | `Thumbnail.test.tsx` ref and test-id tests | Root | A lost ref or `data-testid` fails. Gap: no test covers DOM passthrough, attribute order, or the styling-input merge. | `audit:Thumbnail/api` |
| AR3 | `Thumbnail.test.tsx` uploading test; source review against `spec:AST-086` FR8 | Uploading | An exposed upload Spinner fails. Gap: no automated check fails if the busy state is announced twice. | `audit:Thumbnail/a11y` |
| AR4 | `Thumbnail.stories.tsx` in a browser at fine and coarse pointers | Removable | Gap: no automated target-size check; the fine-pointer size is the recorded gap. | `audit:Thumbnail/a11y` |
diff --git a/packages/core/src/Thumbnail/Thumbnail.test.tsx b/packages/core/src/Thumbnail/Thumbnail.test.tsx
index 19bc7c36ee..5b9215b438 100644
--- a/packages/core/src/Thumbnail/Thumbnail.test.tsx
+++ b/packages/core/src/Thumbnail/Thumbnail.test.tsx
@@ -149,24 +149,127 @@ describe('Thumbnail', () => {
expect(onClick).toHaveBeenCalledOnce();
});
- it('does not render remove button when disabled', () => {
+ it('keeps a disabled Remove mounted, focusable and announced as disabled, without calling onRemove', async () => {
+ const user = userEvent.setup();
const onRemove = vi.fn();
render(<Thumbnail label="file.png" onRemove={onRemove} isDisabled />);
- expect(screen.queryByRole('button', {name: /Remove/})).toBeNull();
+ const remove = screen.getByRole('button', {name: /Remove/});
+ expect(remove).toHaveAttribute('aria-disabled', 'true');
+ expect(remove).not.toBeDisabled();
+ remove.focus();
+ await user.keyboard('{Enter}');
+ expect(onRemove).not.toHaveBeenCalled();
+ // A click that reaches it (assistive technology dispatching one; the
+ // disabled thumbnail takes no pointer events) calls nothing either.
+ fireEvent.click(remove);
+ expect(onRemove).not.toHaveBeenCalled();
});
- it('does not render onClick button when disabled', () => {
+ it('keeps a disabled Open mounted, focusable and announced as disabled, without calling onClick', async () => {
+ const user = userEvent.setup();
const onClick = vi.fn();
render(
<Thumbnail src="/img.jpg" alt="Test" onClick={onClick} isDisabled />,
);
- expect(screen.queryByRole('button')).toBeNull();
+ const open = screen.getByRole('button', {name: 'Open Test'});
+ expect(open).toHaveAttribute('aria-disabled', 'true');
+ open.focus();
+ await user.keyboard('{Enter}');
+ expect(onClick).not.toHaveBeenCalled();
});
- it('is not interactive when isLoading', () => {
+ it('keeps Open mounted but inert while loading', async () => {
+ const user = userEvent.setup();
const onClick = vi.fn();
render(<Thumbnail src="/img.jpg" alt="Test" onClick={onClick} isLoading />);
- expect(screen.queryByRole('button')).toBeNull();
+ const open = screen.getByRole('button', {name: 'Open Test'});
+ expect(open).toHaveAttribute('aria-disabled', 'true');
+ await user.click(open);
+ expect(onClick).not.toHaveBeenCalled();
+ });
+
+ it.each([
+ ['disabled', {isDisabled: true}],
+ ['loading', {isLoading: true}],
+ ])(
+ 'stops a press on a %s Open before it reaches an ancestor (spec:AST-085 FR2)',
+ async (_state, stateProps) => {
+ const user = userEvent.setup();
+ const onClick = vi.fn();
+ const onAncestorClick = vi.fn();
+ render(
+ <div onClick={onAncestorClick}>
+ <Thumbnail
+ src="/img.jpg"
+ alt="Test"
+ onClick={onClick}
+ {...stateProps}
+ />
+ </div>,
+ );
+ const open = screen.getByRole('button', {name: 'Open Test'});
+ open.focus();
+ await user.keyboard('{Enter}');
+ await user.keyboard(' ');
+ // A disabled thumbnail takes no pointer events, so the click is
+ // dispatched directly, as assistive technology may.
+ fireEvent.click(open);
+ expect(onClick).not.toHaveBeenCalled();
+ expect(onAncestorClick).not.toHaveBeenCalled();
+ },
+ );
+
+ it.each([
+ ['a disabled Open', {isDisabled: true}, 'Open Test'],
+ ['a loading Open', {isLoading: true}, 'Open Test'],
+ ['a disabled Remove', {isDisabled: true}, /Remove/],
+ ] as const)(
+ 'Enter and Space on %s dispatch no click to any listener (spec:AST-085 FR2)',
+ async (_name, stateProps, buttonName) => {
+ const user = userEvent.setup();
+ const clicks = vi.fn();
+ document.addEventListener('click', clicks, {capture: true});
+ try {
+ render(
+ <Thumbnail
+ src="/img.jpg"
+ alt="Test"
+ onClick={vi.fn()}
+ onRemove={vi.fn()}
+ {...stateProps}
+ />,
+ );
+ screen.getByRole('button', {name: buttonName}).focus();
+ await user.keyboard('{Enter}');
+ await user.keyboard(' ');
+ expect(clicks).not.toHaveBeenCalled();
+ } finally {
+ document.removeEventListener('click', clicks, {capture: true});
+ }
+ },
+ );
+
+ it('keeps focus on Open and Remove when the thumbnail becomes loading or disabled (spec:AST-085 FR4)', () => {
+ const props = {
+ src: '/img.jpg',
+ alt: 'Test',
+ onClick: vi.fn(),
+ onRemove: vi.fn(),
+ };
+ const {rerender} = render(<Thumbnail {...props} />);
+ const open = screen.getByRole('button', {name: 'Open Test'});
+ open.focus();
+ rerender(<Thumbnail {...props} isLoading />);
+ expect(document.activeElement).toBe(open);
+ rerender(<Thumbnail {...props} isDisabled />);
+ expect(document.activeElement).toBe(open);
+
+ rerender(<Thumbnail {...props} />);
+ const remove = screen.getByRole('button', {name: /Remove/});
+ remove.focus();
+ rerender(<Thumbnail {...props} isDisabled />);
+ expect(document.activeElement).toBe(remove);
+ expect(remove).toHaveAttribute('aria-disabled', 'true');
});
it('forwards ref to root element', () => {
diff --git a/packages/core/src/Thumbnail/Thumbnail.tsx b/packages/core/src/Thumbnail/Thumbnail.tsx
index 120a11edba..441db9c6ca 100644
--- a/packages/core/src/Thumbnail/Thumbnail.tsx
+++ b/packages/core/src/Thumbnail/Thumbnail.tsx
@@ -379,7 +379,10 @@ export function Thumbnail({
);
const showPlaceholder = (!isLoading && !hasSrc) || hasError;
const isInteractive = onClick != null && !isDisabled && !isLoading;
- const hasRemove = onRemove != null && !isDisabled;
+ // Open and Remove stay mounted while they cannot act, inert and announced
+ // as disabled, so a focused one keeps focus (spec:AST-085 FR1, FR4, FR6).
+ const hasOpen = onClick != null;
+ const hasRemove = onRemove != null;
const isHoverReveal = hasRemove && showRemoveOn === 'hover';
const {getContainerProps, getContentRevealProps} = useContainerReveal({
isEnabled: isHoverReveal,
@@ -449,9 +452,13 @@ export function Thumbnail({
variant="secondary"
size="sm"
isIconOnly
+ aria-disabled={isDisabled ? 'true' : undefined}
+ onKeyDown={isDisabled ? suppressActivationKeys : undefined}
onClick={e => {
e.stopPropagation();
- onRemove(e);
+ if (!isDisabled) {
+ onRemove(e);
+ }
}}
xstyle={styles.removeButtonOverrides}
/>
@@ -484,11 +491,13 @@ export function Thumbnail({
),
isHoverReveal ? getContainerProps() : {},
)}>
- {isInteractive ? (
+ {hasOpen ? (
<button
type="button"
- onClick={onClick}
+ onClick={isInteractive ? onClick : stopInertPress}
+ onKeyDown={isInteractive ? undefined : suppressActivationKeys}
aria-label={t('@astryx.thumbnail.open', {accessibleName})}
+ aria-disabled={isInteractive ? undefined : 'true'}
{...stylex.props(styles.interactiveButton)}>
{imageContent}
</button>
@@ -514,3 +523,24 @@ export function Thumbnail({
}
Thumbnail.displayName = 'Thumbnail';
+
+/**
+ * Enter and Space on an inert action dispatch no click at all, so no listener
+ * anywhere receives one (spec:AST-085 FR2), as Button does for its own
+ * aria-disabled state.
+ */
+function suppressActivationKeys(event: React.KeyboardEvent<HTMLElement>) {
+ if (event.key === 'Enter' || event.key === ' ') {
+ event.preventDefault();
+ }
+}
+
+/**
+ * A click that still reaches an inert Open (a pointer, or assistive
+ * technology dispatching one) calls nothing and stops here, so an ancestor's
+ * click handler does not take it either (spec:AST-085 FR2).
+ */
+function stopInertPress(event: React.MouseEvent<HTMLButtonElement>) {
+ event.preventDefault();
+ event.stopPropagation();
+}