You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am implementing a react-select Multi-Select with dnd-sortable items. The entire select can be "tabbed" into, but we do not want each and every item within the select to be tabbable (and I suppose thus not focusable).
react-select exposes arrow functionality to select an item for deletion, e.g. click arrowLeft and then Delete to delete a certain item. I want to modify this so that "arrow-focusing" an item makes that item focused with dnd-sortable. If I am able to set an item as the current focused element in dnd-kit, I would expect to be able to press Space or Enter to select that item, and move it around with left or right arrows.
So - if I know which item is "focused" by react-select, can I somehow pass that to the KeyboardSensor or similar, allowing me to keyboard-drag that item?
Edit: I have made the drag-and-drop functionality work, so I only struggle with keyboard accessibility here.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am implementing a
react-select
Multi-Select with dnd-sortable items. The entire select can be "tabbed" into, but we do not want each and every item within the select to be tabbable (and I suppose thus not focusable).Example: https://react-select.com/advanced#sortable-multiselect (this example uses react-sortable-hoc, which is how I got into dnd-kit)
react-select
exposes arrow functionality to select an item for deletion, e.g. clickarrowLeft
and thenDelete
to delete a certain item. I want to modify this so that "arrow-focusing" an item makes that item focused with dnd-sortable. If I am able to set an item as the current focused element in dnd-kit, I would expect to be able to pressSpace
orEnter
to select that item, and move it around with left or right arrows.So - if I know which item is "focused" by
react-select
, can I somehow pass that to theKeyboardSensor
or similar, allowing me to keyboard-drag that item?Edit: I have made the drag-and-drop functionality work, so I only struggle with keyboard accessibility here.
Beta Was this translation helpful? Give feedback.
All reactions