Replies: 4 comments 5 replies
-
I have read and followed the documentation here: https://react-spectrum.adobe.com/react-stately/selection.html |
Beta Was this translation helpful? Give feedback.
-
let [selectedKeys, setSelectedKeys] = useState(["000f4246"]); |
Beta Was this translation helpful? Give feedback.
-
This is great, thanks. I am unable to reproduce the issue I'm having with a slightly modified configuration in CodeSandbox. State has been lifted to the parent object so that it can interact with another table in my case. I wonder if that is the issue? I am also using this with CEP so even odds it's just some weird bug because of that. Using selectedKeys vs selectedKey also breaks the table highlighting (in CEP at least). No errors in the console though. https://codesandbox.io/s/heuristic-currying-55p307?file=/src/App.js |
Beta Was this translation helpful? Give feedback.
-
Why return "all" instead of just all the selected keys? Is there a way of changing that behaviour? |
Beta Was this translation helpful? Give feedback.
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 have assigned keys to my rows explicitly and followed the instructions in the documentation very closely, but when I try to use setSelectedKey and then read the value of selectedKey I get back null.
I can confirm that the keys are not being seen because when I specify a default key the corresponding item is not selected.
What exactly is
onSelectionChange
passing tosetSelectedKey
? Is there a specific field or element that the key needs to be on in order to be picked up? Currently I have it assigned to the row, reasoning that the row is what is being selected/highlighted.Beta Was this translation helpful? Give feedback.
All reactions