Skip to content

Commit 573f3a7

Browse files
[internal] Fix naming to match convention
1 parent a992f66 commit 573f3a7

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

packages/react/src/autocomplete/root/AutocompleteRoot.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function AutocompleteRoot<Value>(props: AutocompleteRoot.Props<Value>): R
2929
autoHighlight = false,
3030
itemToStringValue,
3131
items,
32-
...rest
32+
...other
3333
} = props;
3434

3535
const enableInline = mode === 'inline' || mode === 'both';
@@ -71,21 +71,21 @@ export function AutocompleteRoot<Value>(props: AutocompleteRoot.Props<Value>): R
7171
const collator = useCoreFilter(DEFAULT_FILTER_OPTIONS);
7272

7373
const baseFilter = React.useMemo(() => {
74-
if (rest.filter) {
75-
return rest.filter;
74+
if (other.filter) {
75+
return other.filter;
7676
}
7777

7878
return (item: any, query: string, toString?: (item: any) => string) => {
7979
return collator.contains(stringifyItem(item, toString), query);
8080
};
81-
}, [rest, collator]);
81+
}, [other, collator]);
8282

8383
const query = String(isControlled ? value : internalValue).trim();
8484

8585
// In "both", wrap filtering to use only the typed value, ignoring overlay.
86-
let effectiveFilter: typeof rest.filter;
86+
let effectiveFilter: typeof other.filter;
8787
if (mode !== 'both') {
88-
effectiveFilter = staticItems ? null : rest.filter;
88+
effectiveFilter = staticItems ? null : other.filter;
8989
} else {
9090
effectiveFilter = (item: any, _query: string, toString?: (item: any) => string) => {
9191
return baseFilter(item, query, toString);
@@ -113,7 +113,7 @@ export function AutocompleteRoot<Value>(props: AutocompleteRoot.Props<Value>): R
113113

114114
return (
115115
<ComboboxRootInternal
116-
{...rest}
116+
{...other}
117117
items={items as any} // Block `Group` type inference
118118
itemToStringLabel={itemToStringValue}
119119
openOnInputClick={openOnInputClick}

packages/react/src/combobox/root/ComboboxRoot.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ export function ComboboxRoot<
1414
SelectedValue = ItemValue,
1515
Multiple extends boolean | undefined = false,
1616
>(props: ComboboxRoot.Props<ItemValue, SelectedValue, Multiple>): React.JSX.Element {
17-
const { multiple = false as Multiple, defaultValue, value, onValueChange, ...rest } = props;
17+
const { multiple = false as Multiple, defaultValue, value, onValueChange, ...other } = props;
1818

1919
return (
2020
<ComboboxRootInternal
21-
{...(rest as any)}
21+
{...(other as any)}
2222
selectionMode={multiple ? 'multiple' : 'single'}
2323
selectedValue={value}
2424
defaultSelectedValue={defaultValue}

packages/react/src/utils/FocusGuard.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,19 @@ export const FocusGuard = React.forwardRef(function FocusGuard(
2323
}, []);
2424

2525
const restProps = {
26-
ref,
2726
tabIndex: 0,
2827
// Role is only for VoiceOver
2928
role,
30-
'aria-hidden': role ? undefined : true,
31-
style: visuallyHidden,
3229
};
3330

34-
return <span {...props} {...restProps} data-base-ui-focus-guard="" />;
31+
return (
32+
<span
33+
{...props}
34+
ref={ref}
35+
style={visuallyHidden}
36+
aria-hidden={role ? undefined : true}
37+
{...restProps}
38+
data-base-ui-focus-guard=""
39+
/>
40+
);
3541
});

0 commit comments

Comments
 (0)