Skip to content

Card component does not support event callbacks when not wrapped in CardView #9674

@ToyWalrus

Description

@ToyWalrus

Provide a general summary of the issue here

The Card component states in its documentation that it supports the following props:

  • onAction
  • onPress
  • onPressStart
  • onPressEnd
  • onPressChange
  • onPressUp

However, the "press" actions do not actually trigger any callbacks when the Card component is not wrapped in a CardView

🤔 Expected Behavior?

The onPress- props should be triggered when clicking on the card, as described by the docs. Either that, or remove the documentation saying it's supported.

😯 Current Behavior

Callback is not triggered

💁 Possible Solution

No response

🔦 Context

No response

🖥️ Steps to Reproduce

import { Card, Content, Text } from '@react-spectrum/s2';

const MyComponent = () => {
return (
  <Card onPress={(e) => console.log(e)}>
    <Content>
      <Text>Hi there</Text>
    </Content>
  </Card>
);
}

Version

^1.0.0

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

MacOS - Tahoe 26.2

🧢 Your Company/Team

Adobe/Incubator

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    CardViewbugSomething isn't working

    Type

    Projects

    Status

    ✏️ To Groom

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions