Skip to content

Commit eccc080

Browse files
authored
fix: prevent disabled item from receiving focus when clicked (#8246)
1 parent b7f8ed1 commit eccc080

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/@react-aria/selection/src/useSelectableItem.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ export function useSelectableItem(options: SelectableItemOptions): SelectableIte
382382
return {
383383
itemProps: mergeProps(
384384
itemProps,
385-
allowsSelection || hasPrimaryAction || shouldUseVirtualFocus ? pressProps : {},
385+
allowsSelection || hasPrimaryAction || (shouldUseVirtualFocus && !isDisabled) ? pressProps : {},
386386
longPressEnabled ? longPressProps : {},
387387
{onDoubleClick, onDragStartCapture, onClick, id},
388388
// Prevent DOM focus from moving on mouse down when using virtual focus

0 commit comments

Comments
 (0)