Conversation
| for (let item of state.collection) { | ||
| if (item.type === 'item' && !prevCollection.getItem(item.key)) { | ||
| let key = state.collection.getFirstKey(); | ||
| while (key != null) { | ||
| let item = state.collection.getItem(key); | ||
| if (item?.type === 'item' && !prevCollection.getItem(item.key)) { |
There was a problem hiding this comment.
Root issue was that using the collection iterator for TableCollection returns just the column header and the body, not the actual rows. Walking the items should be more accurate I believe
|
Build successful! 🎉 |
|
Some behaviors are inconsistent with the previous version, as shown below: Video.Project.mp4 |
|
@chirokas thanks for reporting those, they both seem unrelated to the changes here since they reproduce on the latest build on main: https://reactspectrum.blob.core.windows.net/reactspectrum/46be2856add60b1d7e1b91b393b9bfa5f002f807/storybook/index.html?path=/story/react-aria-components-tree--tree-with-drag-and-drop&args=selectionMode:multiple&providerSwitcher-express=false. I'll see if I can dig up the commits that may have changed these behaviors since IMO they both seem like regressions EDIT: I've added fixes for these, the original issue was the change we pushed in #9751 that your original changes seem to address. The approach I took is slightly different let me know what you think |
…select all child rows on drop
| expect(secondTreeTester.selectedRows).toHaveLength(9); | ||
| }); | ||
|
|
||
| it('should focus the parent row when dropped on if it isnt expanded', async () => { |
There was a problem hiding this comment.
These two tests actually always pass without the changes in useDroppableCollection, not quite sure why it differs from the observed browser behavior. Also interesting to note is that having Strict Mode on in the storybook locally also will cause the issue to not appear...
Still digging as to why this would be the case
|
Build successful! 🎉 |
## API Changes
@react-spectrum/s2/@react-spectrum/s2:ActionMenu ActionMenu <T extends {}> {
UNSAFE_className?: UnsafeClassName
UNSAFE_style?: CSSProperties
align?: 'start' | 'end' = 'start'
aria-describedby?: string
aria-details?: string
aria-label?: string
aria-labelledby?: string
autoFocus?: boolean
children: ReactNode | (T) => ReactNode
defaultOpen?: boolean
direction?: 'bottom' | 'top' | 'left' | 'right' | 'start' | 'end' = 'bottom'
disabledKeys?: Iterable<Key>
id?: string
isDisabled?: boolean
isOpen?: boolean
isQuiet?: boolean
items?: Iterable<T>
menuSize?: 'S' | 'M' | 'L' | 'XL' = 'M'
onAction?: (Key) => void
onOpenChange?: (boolean) => void
- shouldCloseOnSelect?: boolean
shouldFlip?: boolean = true
size?: 'XS' | 'S' | 'M' | 'L' | 'XL' = 'M'
styles?: StylesProp
}/@react-spectrum/s2:ActionMenuProps ActionMenuProps <T> {
UNSAFE_className?: UnsafeClassName
UNSAFE_style?: CSSProperties
align?: 'start' | 'end' = 'start'
aria-describedby?: string
aria-details?: string
aria-label?: string
aria-labelledby?: string
autoFocus?: boolean
children: ReactNode | (T) => ReactNode
defaultOpen?: boolean
direction?: 'bottom' | 'top' | 'left' | 'right' | 'start' | 'end' = 'bottom'
disabledKeys?: Iterable<Key>
id?: string
isDisabled?: boolean
isOpen?: boolean
isQuiet?: boolean
items?: Iterable<T>
menuSize?: 'S' | 'M' | 'L' | 'XL' = 'M'
onAction?: (Key) => void
onOpenChange?: (boolean) => void
- shouldCloseOnSelect?: boolean
shouldFlip?: boolean = true
size?: 'XS' | 'S' | 'M' | 'L' | 'XL' = 'M'
styles?: StylesProp
} |
Fixes a regression from #9751 that was found in testing.
✅ Pull Request Checklist:
📝 Test Instructions:
In the RAC docs, go to the Drag and Drop page -> multiple positions and try dragging and dropping a table row from the first table into the second row. The dropped row should be selected and focused on drop. Check the other collection components drag and drop behavior as well
🧢 Your Project:
RSP