adobe / adobe/react-spectrum

[RAC] Not possible to use "useLongPress" with Table Row - event and labelling props get filtered out.

Open
#7,987 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
15.9k
Forks
1.6k
Avg merge
3d 9m
Merged PRs (30d)
59

Description

### Provide a general summary of the issue here

I am trying to use the `useLongPress` hook with react-aria-components Row component.

The props provided by useLongPress get filtered by `filterDOMProps` and are not rendered.

### 🤔 Expected Behavior?

event handlers and labelling like what is provided by useLongPress should work with the Row.

### 😯 Current Behavior

props are filtered by filterDOMProps.

### 💁 Possible Solution

filterDOMProps could allow labelling props so the aria-describedby is let on to the TR.

for the event handling - a propNames set can be included which allows the events required by useLongPress - onKeyDown, onClick, onDragStart, onMouseDown, onPointerDown, onPointerEnter, onPointerLeave, onPointerUp.

Please let me know if this is ok and I will make a PR.

### 🔦 Context

We have a requirement to allow LongPress and Press on a table row to trigger an action.

### 🖥️ Steps to Reproduce

N/A (Maybe this should be a feature request?)

### Version

3.38.1 / 1.7.1

### What browsers are you seeing the problem on?

Chrome

### If other, please specify.

_No response_

### What operating system are you using?

Windows

### 🧢 Your Company/Team

Saxo Bank

### 🕷 Tracking Issue

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.