Space on a `type="submit"` or `type="reset"` Button calls onPress and onClick twice

Author: alexandru-bereghici-toCreated Sep 28, 2026Updated Sep 30, 2026
LabelsusePress

Provide a general summary of the issue here

Pressing Space on a RAC Button with type="submit" or type="reset" calls onPress and onClick twice. Enter calls them once.

Expected Behavior?

onPress and onClick run once per key press.

Current Behavior

type=submit key=Space: ["onPress","onClick","onPress","onClick","form-submit"]
type=submit key=Enter: ["form-submit","onPress","onClick"]
type=reset  key=Space: ["onPress","onClick","onPress","onClick","form-reset"]
type=reset  key=Enter: ["form-reset","onPress","onClick"]

The form submits (or resets) once; only the handlers run twice.

Possible Solution

In react-aria/dist/private/interactions/usePress.mjs (3.52.1):

  • shouldPreventDefaultUp returns false for submit and reset buttons (704-708), so the Space keyup is not prevented and the browser fires its activation click (on purpose, #1593).
  • onKeyUp fires onPress through triggerPressEndEvent and onClick through triggerSyntheticClick (309-311), then clears state.isPressed (322).
  • The browser's activation click then reaches pressProps.onClick with !state.isPressed and a virtual click (284), which runs a second press.

Enter is unaffected because its activation click fires on keydown, while state.isPressed is still true. Related: #7891 (the onClick alias).

Context

Found while building a design system on React Aria Components. Observed in headless Chromium (Playwright 1.63, real key and mouse events) with react-aria-components 1.21.1 / react-aria 3.52.1 / react-stately 3.50.0 and no other code.

️ Steps to Reproduce

javascript
import { Button } from "react-aria-components";

export function Repro() {
  return ["submit", "reset"].map((type) => (
    <form
      key={type}
      onSubmit={(e) => { e.preventDefault(); console.log("form-submit"); }}
      onReset={() => console.log("form-reset")}
    >
      <Button type={type} onPress={() => console.log("onPress")} onClick={() => console.log("onClick")}>
        {type}
      </Button>
    </form>
  ));
}

Focus a button, press Space. Repeat with Enter.

Version

react-aria-components 1.21.1, react-aria 3.52.1, react-stately 3.50.0, React 19.3.0

What browsers are you seeing the problem on?

Chrome

What operating system are you using?

macOS

Your Company/Team

No response

Tracking Issue

No response