adobe / adobe/react-spectrum

Section support in GridList Drag And Drop

Open
#9,192 1 comment 0 reactions 0 assignees View on GitHub
drag and drop
Dominant language
TypeScript
Stars
15.9k
Forks
1.6k
Avg merge
3d 9m
Merged PRs (30d)
59

Description

### Provide a general summary of the feature here

Hi!

I wanted to ask if there are any plans to support sections with Drag and Drop in GridList. I know that Sections is still marked as alpha, so I completely understand it’s early, just curious if this feature is on the roadmap yet.

P.S. I’m asking because I’ve tried getting Drag and Drop to work with sections but haven’t had any luck. The lack of documentation, combined with the number of workarounds I’ve had to try, makes me think it’s not fully supported yet.

Thanks!

### 🤔 Expected Behavior?

Ideally it would work list this, but in my experience I've had to flatten the list and simulate headings into its own GridList.Item.

```typescript
const list = useListData({ initialItems: initialItemsContainingLists });
const {dragAndDropHooks} = useDragAndDrop({ ...dragAndDropOptions });


{section => (

{section.name}

{item => {item.name}}


)}

```

### 😯 Current Behavior

The current behavior prevents me from using sections. Like I wrote up top I've had to flatten the list, and simulate section headings inside GridList.Items.

### 💁 Possible Solution

The working example I have is to flatten the list, and simulate section headings as their own GridList.Item. In my implementation, I have a switch statement happening with conditionally renders the type of block I'd like inside my GridList. Not sure how usably this solution is to you guys, I'm sure you have something that's more "primitive" to React Aria cooking!

### 🔦 Context

Like most collections, our GridList have sections.

### 💻 Examples

_No response_

### 🧢 Your Company/Team

Ubiquiti

### 🕷 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.