diff --git a/.changeset/resize-handle-modified-arrows.md b/.changeset/resize-handle-modified-arrows.md
new file mode 100644
index 0000000000000..9f820d50147a5
--- /dev/null
+++ b/.changeset/resize-handle-modified-arrows.md
@@ -0,0 +1,7 @@
+---
+'@astryxdesign/core': patch
+---
+
+[fix] A focused `ResizeHandle` acts only on its own keys: plain arrows, Shift with an arrow, Home, End and Enter. Any other combination, such as Alt, Control or Command with an arrow, Home, End or Enter, or Shift with Home, End or Enter, now passes through to the page, so the browser's own shortcuts on those keys (history navigation, scrolling to the top or bottom) and the app's own shortcuts run.
+
+@cixzhang
diff --git a/docs/specs/components/Resizable/Resizable.spec.md b/docs/specs/components/Resizable/Resizable.spec.md
index 91a3f8fd8e434..a5465142bd285 100644
--- a/docs/specs/components/Resizable/Resizable.spec.md
+++ b/docs/specs/components/Resizable/Resizable.spec.md
@@ -214,8 +214,10 @@ Consumer migration instructions belong in consumer docs and release notes.
the maximum; Enter collapses a collapsible pane and restores it, and the arrow
that grows a collapsed pane opens it one step above its minimum, or at its
`collapsedSize` when that is larger (with snap points, at the snap point
- nearest that size; the shrinking arrow leaves it collapsed). An unbounded
- Handle reports a measured stand-in as `aria-valuemax`: the window's extent
+ nearest that size; the shrinking arrow leaves it collapsed). Only the keys
+ above act; a key pressed with a modifier the map does not name does nothing
+ and is not consumed. An unbounded Handle reports a measured stand-in as
+ `aria-valuemax`: the window's extent
along its axis when no container is supplied, or its container's content box
while a percentage bound observes it, never below its current size or, while
collapsed, its minimum. Implementation gaps under `spec:AST-020/FR15`: the
@@ -265,21 +267,21 @@ Consumer migration instructions belong in consumer docs and release notes.
## Verification map
-| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
-| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
-| FR1 | `ResizeHandle.test.tsx`; `grabZone.interaction.browser.spec.ts` for the zone's place and its short-pane limit; stable visual baseline `core-resizable--horizontal-split` | Default, collapsed, both axes | Handle and Grab zone regressions fail focused tests; a changed default handle comes back changed for review. Gap: no test renders `children` to prove they replace the Grip pill. | `audit:Resizable/anatomy` |
-| FR2 | `themingTargets.test.ts`; source review | Handle, Grip pill, Grab zone | A removed target fails the inventory. `themingTargets.test.ts` catches only a renamed or undocumented target; no check fails if the Handle or Grip pill stops carrying its target. | `audit:Resizable/theming` |
-| FR3 | `ResizeHandle.test.tsx` and `useResizable.test.ts`; storage timing: `ResizeHandle.test.tsx` ("saves the size once, when a drag ends on …", "saves the dragged size once when the split unmounts mid-drag", "still saves each keyboard step at once") and `useResizable.test.ts` ("writes the size a drag reached once, after … releases it", "writes the final size once when the release comes before the last move renders", "keeps the size a region was dragged to when it unmounts mid-drag", "writes only the re-clamped size when the container shrank mid-drag") | Pointer, keyboard, snap, collapse, persistence; RTL drag; disabled keyboard | A changed transformation, an RTL drag that moves against the pointer, keyboard input that resizes a disabled Handle, or a per-move, stale or missing final storage write fails. Gap: no test covers disabled pointer input. | `audit:Resizable/behavior` |
-| FR4 | Source and docs comparison | Horizontal and vertical Handle | Gap: no test detects that the documented `direction` is not reflected. | `audit:Resizable/theming` |
-| FR5, ORD1–ORD3 | `useResizable.test.ts`, `utils.test.ts`, typecheck | Floor, ceiling, default; invalid shapes; basis changes; numeric container parity | Wrong resolution, a rescaled default, a stale clamp, an observer leak, or state, paint, storage, and ARIA that disagree fails. | `audit:Resizable/behavior` |
-| FR6 | `useResizable.test.ts`; typecheck | Numeric bounds; conflicting bounds | A removed alias that type-checks, a numeric bound that is not pixels, or a minimum that wins a conflict fails. | `audit:Resizable/behavior` |
-| FR7 | `ResizeHandle.test.tsx` consumer `onKeyDown` test; source review | Caller props and `onKeyDown` | A consumer `onKeyDown` that stops keyboard resizing, or keyboard resizing that skips the consumer handler, fails. Gap: no test covers other caller props, the styling merge, caller `onFocus`, `onBlur`, or `onDoubleClick`, or a caller `role` or ARIA attribute. | `audit:Resizable/api` |
-| FR8 | `paneSlide.interaction.browser.spec.ts`: a start and an end LayoutPanel collapsed from inside and opened with Enter, a toggle, a controlled `isCollapsed`, a double-click, the grow arrow, a lift past the threshold, a flick toward closing, a pull past the maximum and under the minimum, each at most about 8 px with no reflow, the Handle alone moving over the content, an arrow key at the maximum that draws no band, a panel at the hook's size alone at a limit, a press on the Handle mid-slide, a re-grab at once, 50 ms after and mid-settle after a pull past the maximum, a reopening drag, a hand-built `ResizableProps` pane, and Reduce Motion; `paneReveal.test.tsx` for `expand()`, `resize()` out of collapse, a re-grab while the pane slides shut, and a hook-only pane; source review: the resize gesture takes every pointer type alike | Start and end panes; `collapse()`, `expand()`, Enter, double-click, the grow arrow, a controlled `isCollapsed` change, a lift past `collapsedSize` and a flick; a pull past each limit and its spring-back, for every pointer type; an arrow key at a limit; a press mid-slide; a reopening drag; the hook's `props` and a hand-built object through `resizable`; Reduce Motion | A jump instead of a slide, a slide from the wrong edge, a hard stop at a limit, an edge more than about 8 px past a limit, content that reflows past a limit, a band from an arrow key at a limit, a collapse before the lift, a close not on `springs.settle`, a press mid-slide that misses the Handle, a slide during a reopening drag or on first render, a slide for a hook-only pane or a hand-built object, no slide for the hook's `props`, or a new prop, option or return member fails. | `audit:Resizable/behavior` |
-| AR1 | `ResizeHandle.test.tsx` ("makes the separator focusable", "exposes the region size and bounds via ARIA", "grows the panel by a step on ArrowRight", "shrinks the panel by a step on ArrowLeft", "uses the large step when Shift is held", "jumps to the minimum on Home", "jumps to the maximum on End", "collapses on Enter when the region is collapsible", "inverts the pointer delta under RTL so dragging resizes intuitively", "restores the previous size, not the minimum, when Enter reopens a collapsed pane", "reopens on Enter even when the minimum size sits below the collapse threshold", "reports the window basis as aria-valuemax when no maximum is configured; End leaves an unbounded region alone", "reports the container basis as aria-valuemax while a percentage bound already observes it", "never reports aria-valuemax below aria-valuemin while collapsed in a small window", "reports no aria-valuemax for an unbounded pixel-only region in a container, which stays unobserved", "a grow arrow opens a collapsed pane one step above its minimum; the shrink arrow leaves it collapsed", "a grow arrow opens a collapsed pane at its collapsedSize when the minimum sits below it", "a grow arrow opens a collapsed pane in the reversed layout and under RTL too", "in a reversed layout, ArrowLeft opens a collapsed pane and ArrowRight leaves it collapsed", "under RTL, ArrowLeft opens a collapsed pane and ArrowRight leaves it collapsed", "a grow arrow opens a hand-built collapsed region one step above its minimum", "with snap points, an arrow moves to the adjacent point in its direction and Shift moves two, clamped to the ends", "with snap points past the bounds, a point beyond maxSize or minSize counts as that bound", "with snap points, the arrows follow the reversed layout and the reading direction", "with snap points in a reversed layout, ArrowLeft moves to the next point and ArrowRight to the previous", "with snap points, the grow arrow opens a collapsed pane at the snap point nearest one step above its minimum") and `shippedDirections.test.ts`; `SideNav.test.tsx` ("names the nav it resizes with aria-controls (APG window splitter)"); RTL keyboard mirroring, and the disabled state under the Window Splitter accessibility contract (`internal/a11y-spec`, pending); `ResizeHandle.a11y.test.tsx` and `ResizeHandle.a11y.chromium.spec.ts` | Inline and block axes; LTR and RTL; collapsed; disabled | The Handle loses its role, name, orientation, or value properties; an arrow, Home, End, or Enter stops moving the divider or moves it against the reading direction. | `audit:Resizable/accessibility` |
-| PR1 | `useResizable.test.ts` observer tests | Pixel, percentage default, percentage bound | An observer on a pixel-only path, or one that outlives a final default, fails. | `audit:Resizable/behavior` |
-| Theming anatomy map | `scripts/check-knowledge.mjs` | Canonical anatomy and two targets | Missing, extra, or stale mappings fail repository validation. | `audit:Resizable/theming` |
-| RTL relation (ResizeHandle) | RTL audit curated D4 target (`apps/storybook/rtl-audit/targets.json`) on the `Horizontal split` story, beside the Resizable target | Horizontal split; LTR and RTL | A handle that does not move to the mirrored side of the layout in RTL fails D4. | `audit:Resizable/i18n-rtl` |
-| FR9 | `resizableSlot.test.tsx`: a LayoutPanel and its ResizeHandle given the region, and given its `props` | The region; its `props` | A panel that ignores the region's size, a handle that does not drive it, or a collapse that leaves the panel reachable fails | `audit:Resizable/api` |
+| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
+| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
+| FR1 | `ResizeHandle.test.tsx`; `grabZone.interaction.browser.spec.ts` for the zone's place and its short-pane limit; stable visual baseline `core-resizable--horizontal-split` | Default, collapsed, both axes | Handle and Grab zone regressions fail focused tests; a changed default handle comes back changed for review. Gap: no test renders `children` to prove they replace the Grip pill. | `audit:Resizable/anatomy` |
+| FR2 | `themingTargets.test.ts`; source review | Handle, Grip pill, Grab zone | A removed target fails the inventory. `themingTargets.test.ts` catches only a renamed or undocumented target; no check fails if the Handle or Grip pill stops carrying its target. | `audit:Resizable/theming` |
+| FR3 | `ResizeHandle.test.tsx` and `useResizable.test.ts`; storage timing: `ResizeHandle.test.tsx` ("saves the size once, when a drag ends on …", "saves the dragged size once when the split unmounts mid-drag", "still saves each keyboard step at once") and `useResizable.test.ts` ("writes the size a drag reached once, after … releases it", "writes the final size once when the release comes before the last move renders", "keeps the size a region was dragged to when it unmounts mid-drag", "writes only the re-clamped size when the container shrank mid-drag") | Pointer, keyboard, snap, collapse, persistence; RTL drag; disabled keyboard | A changed transformation, an RTL drag that moves against the pointer, keyboard input that resizes a disabled Handle, or a per-move, stale or missing final storage write fails. Gap: no test covers disabled pointer input. | `audit:Resizable/behavior` |
+| FR4 | Source and docs comparison | Horizontal and vertical Handle | Gap: no test detects that the documented `direction` is not reflected. | `audit:Resizable/theming` |
+| FR5, ORD1–ORD3 | `useResizable.test.ts`, `utils.test.ts`, typecheck | Floor, ceiling, default; invalid shapes; basis changes; numeric container parity | Wrong resolution, a rescaled default, a stale clamp, an observer leak, or state, paint, storage, and ARIA that disagree fails. | `audit:Resizable/behavior` |
+| FR6 | `useResizable.test.ts`; typecheck | Numeric bounds; conflicting bounds | A removed alias that type-checks, a numeric bound that is not pixels, or a minimum that wins a conflict fails. | `audit:Resizable/behavior` |
+| FR7 | `ResizeHandle.test.tsx` consumer `onKeyDown` test; source review | Caller props and `onKeyDown` | A consumer `onKeyDown` that stops keyboard resizing, or keyboard resizing that skips the consumer handler, fails. Gap: no test covers other caller props, the styling merge, caller `onFocus`, `onBlur`, or `onDoubleClick`, or a caller `role` or ARIA attribute. | `audit:Resizable/api` |
+| FR8 | `paneSlide.interaction.browser.spec.ts`: a start and an end LayoutPanel collapsed from inside and opened with Enter, a toggle, a controlled `isCollapsed`, a double-click, the grow arrow, a lift past the threshold, a flick toward closing, a pull past the maximum and under the minimum, each at most about 8 px with no reflow, the Handle alone moving over the content, an arrow key at the maximum that draws no band, a panel at the hook's size alone at a limit, a press on the Handle mid-slide, a re-grab at once, 50 ms after and mid-settle after a pull past the maximum, a reopening drag, a hand-built `ResizableProps` pane, and Reduce Motion; `paneReveal.test.tsx` for `expand()`, `resize()` out of collapse, a re-grab while the pane slides shut, and a hook-only pane; source review: the resize gesture takes every pointer type alike | Start and end panes; `collapse()`, `expand()`, Enter, double-click, the grow arrow, a controlled `isCollapsed` change, a lift past `collapsedSize` and a flick; a pull past each limit and its spring-back, for every pointer type; an arrow key at a limit; a press mid-slide; a reopening drag; the hook's `props` and a hand-built object through `resizable`; Reduce Motion | A jump instead of a slide, a slide from the wrong edge, a hard stop at a limit, an edge more than about 8 px past a limit, content that reflows past a limit, a band from an arrow key at a limit, a collapse before the lift, a close not on `springs.settle`, a press mid-slide that misses the Handle, a slide during a reopening drag or on first render, a slide for a hook-only pane or a hand-built object, no slide for the hook's `props`, or a new prop, option or return member fails. | `audit:Resizable/behavior` |
+| AR1 | `ResizeHandle.test.tsx` ("makes the separator focusable", "exposes the region size and bounds via ARIA", "grows the panel by a step on ArrowRight", "shrinks the panel by a step on ArrowLeft", "uses the large step when Shift is held", "jumps to the minimum on Home", "leaves a key with {modifiers} that the map does not name to the page", "jumps to the maximum on End", "collapses on Enter when the region is collapsible", "inverts the pointer delta under RTL so dragging resizes intuitively", "restores the previous size, not the minimum, when Enter reopens a collapsed pane", "reopens on Enter even when the minimum size sits below the collapse threshold", "reports the window basis as aria-valuemax when no maximum is configured; End leaves an unbounded region alone", "reports the container basis as aria-valuemax while a percentage bound already observes it", "never reports aria-valuemax below aria-valuemin while collapsed in a small window", "reports no aria-valuemax for an unbounded pixel-only region in a container, which stays unobserved", "a grow arrow opens a collapsed pane one step above its minimum; the shrink arrow leaves it collapsed", "a grow arrow opens a collapsed pane at its collapsedSize when the minimum sits below it", "a grow arrow opens a collapsed pane in the reversed layout and under RTL too", "in a reversed layout, ArrowLeft opens a collapsed pane and ArrowRight leaves it collapsed", "under RTL, ArrowLeft opens a collapsed pane and ArrowRight leaves it collapsed", "a grow arrow opens a hand-built collapsed region one step above its minimum", "with snap points, an arrow moves to the adjacent point in its direction and Shift moves two, clamped to the ends", "with snap points past the bounds, a point beyond maxSize or minSize counts as that bound", "with snap points, the arrows follow the reversed layout and the reading direction", "with snap points in a reversed layout, ArrowLeft moves to the next point and ArrowRight to the previous", "with snap points, the grow arrow opens a collapsed pane at the snap point nearest one step above its minimum") and `shippedDirections.test.ts`; `SideNav.test.tsx` ("names the nav it resizes with aria-controls (APG window splitter)"); RTL keyboard mirroring, and the disabled state under the Window Splitter accessibility contract (`internal/a11y-spec`, pending); `ResizeHandle.a11y.test.tsx` and `ResizeHandle.a11y.chromium.spec.ts` | Inline and block axes; LTR and RTL; collapsed; disabled | The Handle loses its role, name, orientation, or value properties; an arrow, Home, End, or Enter stops moving the divider or moves it against the reading direction. | `audit:Resizable/accessibility` |
+| PR1 | `useResizable.test.ts` observer tests | Pixel, percentage default, percentage bound | An observer on a pixel-only path, or one that outlives a final default, fails. | `audit:Resizable/behavior` |
+| Theming anatomy map | `scripts/check-knowledge.mjs` | Canonical anatomy and two targets | Missing, extra, or stale mappings fail repository validation. | `audit:Resizable/theming` |
+| RTL relation (ResizeHandle) | RTL audit curated D4 target (`apps/storybook/rtl-audit/targets.json`) on the `Horizontal split` story, beside the Resizable target | Horizontal split; LTR and RTL | A handle that does not move to the mirrored side of the layout in RTL fails D4. | `audit:Resizable/i18n-rtl` |
+| FR9 | `resizableSlot.test.tsx`: a LayoutPanel and its ResizeHandle given the region, and given its `props` | The region; its `props` | A panel that ignores the region's size, a handle that does not drive it, or a collapse that leaves the panel reachable fails | `audit:Resizable/api` |
## Decision log
diff --git a/packages/core/src/Resizable/ResizeHandle.test.tsx b/packages/core/src/Resizable/ResizeHandle.test.tsx
index d4c8e01b10df7..007a07cbaa48d 100644
--- a/packages/core/src/Resizable/ResizeHandle.test.tsx
+++ b/packages/core/src/Resizable/ResizeHandle.test.tsx
@@ -168,6 +168,35 @@ describe('ResizeHandle', () => {
);
});
+ const ALL_KEYS = [
+ 'ArrowRight',
+ 'ArrowLeft',
+ 'ArrowUp',
+ 'ArrowDown',
+ 'Home',
+ 'End',
+ 'Enter',
+ ];
+ it.each([
+ {modifiers: {altKey: true}, keys: ALL_KEYS},
+ {modifiers: {ctrlKey: true}, keys: ALL_KEYS},
+ {modifiers: {metaKey: true}, keys: ALL_KEYS},
+ {modifiers: {metaKey: true, shiftKey: true}, keys: ALL_KEYS},
+ {modifiers: {shiftKey: true}, keys: ['Home', 'End', 'Enter']},
+ ])(
+ 'leaves a key with $modifiers that the map does not name to the page',
+ ({modifiers, keys}) => {
+ render();
+ const separator = getSeparator();
+ act(() => separator.focus());
+ for (const key of keys) {
+ const isNotConsumed = fireEvent.keyDown(separator, {key, ...modifiers});
+ expect(isNotConsumed, key).toBe(true);
+ expect(separator, key).toHaveAttribute('aria-valuenow', '200');
+ }
+ },
+ );
+
it('jumps to the minimum on Home', () => {
render();
const separator = getSeparator();
diff --git a/packages/core/src/Resizable/resizeGesture.ts b/packages/core/src/Resizable/resizeGesture.ts
index f5343896026e9..153ddea66e294 100644
--- a/packages/core/src/Resizable/resizeGesture.ts
+++ b/packages/core/src/Resizable/resizeGesture.ts
@@ -76,6 +76,9 @@ export interface ResizeGesturePointerEvent {
export interface ResizeGestureKeyEvent {
readonly key: string;
readonly shiftKey: boolean;
+ readonly altKey: boolean;
+ readonly ctrlKey: boolean;
+ readonly metaKey: boolean;
preventDefault(): void;
}
@@ -293,6 +296,17 @@ export function createResizeGesture(
if (config.isDisabled) {
return;
}
+ // Only the key map acts: a plain key, or Shift with an arrow. Other
+ // modified keys belong to the browser (history navigation, scrolling to
+ // the top or bottom) and to app shortcuts, so they pass through.
+ if (
+ event.altKey ||
+ event.ctrlKey ||
+ event.metaKey ||
+ (event.shiftKey && !event.key.startsWith('Arrow'))
+ ) {
+ return;
+ }
const state = model.state();
const isHorizontal = config.direction === 'horizontal';
const sign = config.isReversed ? -1 : 1;