Implement a right-click contextmenu in a Table? #5387
Unanswered
tarngerine
asked this question in
Q&A
Replies: 1 comment 1 reply
-
We haven't done any custom context menus anywhere in React Aria or React Spectrum thus far unfortunately, so this would be new territory. If just using hooks from React Aria, you could probably get something going by preventing the default onContextMenu event and controlling an overlay. I think having something built into RAC would probably need an RFC to get discussion started. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm having trouble understanding how to use the react-aria-components
Table
with a custom contextual menu. I want to add a right-click menu to each row, which allows the user to perform actions for that row.I can't seem to wrap the entire row in any non-Table component, e.g. if I put a
<div>
around the<Row>
the component immediately stops rendering any rows (renders the empty state), same for putting a sibling to<Cell>
s within<Row>
(related: i would expect it to error instead of just... empty). The only place I can insert my own elements are in side aCell
. Why is this?I can't attach event handlers to the
Row
itself, nor add an arbitrary element inside aRow
(as mentioned above) to support this.Is there an approach here that makes more sense in react-aria world?
Beta Was this translation helpful? Give feedback.
All reactions