@@ -22,9 +22,7 @@ export interface BreadcrumbsProps<T> extends Omit<CollectionProps<T>, 'disabledK
22
22
/** Whether the breadcrumbs are disabled. */
23
23
isDisabled ?: boolean ,
24
24
/** Handler that is called when a breadcrumb is clicked. */
25
- onAction ?: ( key : Key ) => void ,
26
- /** Whether to autoFocus the last Breadcrumb item when the Breadcrumbs render. */
27
- autoFocusCurrent ?: boolean
25
+ onAction ?: ( key : Key ) => void
28
26
}
29
27
30
28
export const BreadcrumbsContext = createContext < ContextValue < BreadcrumbsProps < any > , HTMLOListElement > > ( null ) ;
@@ -56,18 +54,14 @@ function BreadcrumbsInner<T extends object>({props, collection, breadcrumbsRef:
56
54
slot = { props . slot || undefined }
57
55
style = { props . style }
58
56
className = { props . className ?? 'react-aria-Breadcrumbs' } >
59
- { [ ...collection ] . map ( ( node , i ) => {
60
- let isCurrent = i === collection . size - 1 ;
61
- return (
62
- < BreadcrumbItem
63
- key = { node . key }
64
- node = { node }
65
- isCurrent = { isCurrent }
66
- isDisabled = { props . isDisabled }
67
- onAction = { props . onAction }
68
- autoFocus = { props . autoFocusCurrent && isCurrent } />
69
- ) ;
70
- } ) }
57
+ { [ ...collection ] . map ( ( node , i ) => (
58
+ < BreadcrumbItem
59
+ key = { node . key }
60
+ node = { node }
61
+ isCurrent = { i === collection . size - 1 }
62
+ isDisabled = { props . isDisabled }
63
+ onAction = { props . onAction } />
64
+ ) ) }
71
65
</ ol >
72
66
) ;
73
67
}
@@ -99,17 +93,15 @@ interface BreadcrumbItemProps {
99
93
node : Node < object > ,
100
94
isCurrent : boolean ,
101
95
isDisabled ?: boolean ,
102
- onAction ?: ( key : Key ) => void ,
103
- autoFocus ?: boolean
96
+ onAction ?: ( key : Key ) => void
104
97
}
105
98
106
- function BreadcrumbItem ( { node, isCurrent, isDisabled, onAction, autoFocus } : BreadcrumbItemProps ) {
99
+ function BreadcrumbItem ( { node, isCurrent, isDisabled, onAction} : BreadcrumbItemProps ) {
107
100
// Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.
108
101
let linkProps = {
109
102
'aria-current' : isCurrent ? 'page' : null ,
110
103
isDisabled : isDisabled || isCurrent ,
111
- onPress : ( ) => onAction ?.( node . key ) ,
112
- autoFocus : autoFocus
104
+ onPress : ( ) => onAction ?.( node . key )
113
105
} ;
114
106
115
107
return (
0 commit comments