File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
packages/react-aria-components Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -275,6 +275,8 @@ function GridListRow({item}) {
275
275
state
276
276
) ;
277
277
278
+ let buttonProps = state . selectionManager . disabledBehavior === 'all' && states . isDisabled ? { isDisabled : true } : { } ;
279
+
278
280
let draggableItem : DraggableItemResult | null = null ;
279
281
if ( dragState && dragAndDropHooks ) {
280
282
draggableItem = dragAndDropHooks . useDraggableItem ! ( { key : item . key , hasDragButton : true } , dragState ) ;
@@ -359,7 +361,7 @@ function GridListRow({item}) {
359
361
} ] ,
360
362
[ ButtonContext , {
361
363
slots : {
362
- [ DEFAULT_SLOT ] : { } ,
364
+ [ DEFAULT_SLOT ] : buttonProps ,
363
365
drag : {
364
366
...draggableItem ?. dragButtonProps ,
365
367
ref : dragButtonRef ,
Original file line number Diff line number Diff line change @@ -231,12 +231,13 @@ describe('GridList', () => {
231
231
let { getAllByRole} = render (
232
232
< GridList aria-label = "Test" >
233
233
< GridListItem id = "cat" > Cat</ GridListItem >
234
- < GridListItem id = "dog" isDisabled > Dog</ GridListItem >
234
+ < GridListItem id = "dog" textValue = "Dog" isDisabled > Dog < Button aria-label = "Info" > ⓘ </ Button > </ GridListItem >
235
235
< GridListItem id = "kangaroo" > Kangaroo</ GridListItem >
236
236
</ GridList >
237
237
) ;
238
238
let items = getAllByRole ( 'row' ) ;
239
239
expect ( items [ 1 ] ) . toHaveAttribute ( 'aria-disabled' , 'true' ) ;
240
+ expect ( within ( items [ 1 ] ) . getByRole ( 'button' ) ) . toBeDisabled ( ) ;
240
241
241
242
await user . tab ( ) ;
242
243
expect ( document . activeElement ) . toBe ( items [ 0 ] ) ;
You can’t perform that action at this time.
0 commit comments