Skip to content

Commit 7e403a6

Browse files
authored
fix: pass dom props to button group (#8005)
1 parent cea861e commit 7e403a6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/@react-spectrum/s2/src/ButtonGroup.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ import {ButtonContext, LinkButtonContext} from './Button';
1414
import {ContextValue, Provider, SlotProps} from 'react-aria-components';
1515
import {createContext, forwardRef, ReactNode, useCallback, useRef} from 'react';
1616
import {DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';
17+
import {filterDOMProps, useLayoutEffect, useValueEffect} from '@react-aria/utils';
1718
import {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
1819
import {style} from '../style' with {type: 'macro'};
1920
import {
2021
useDOMRef,
2122
useResizeObserver
2223
} from '@react-spectrum/utils';
23-
import {useLayoutEffect, useValueEffect} from '@react-aria/utils';
2424
import {useSpectrumContextProps} from './useSpectrumContextProps';
2525

2626
interface ButtonGroupStyleProps {
@@ -112,7 +112,8 @@ export const ButtonGroup = forwardRef(function ButtonGroup(props: ButtonGroupPro
112112
orientation = 'horizontal',
113113
align = 'start',
114114
children,
115-
isDisabled
115+
isDisabled,
116+
...otherProps
116117
} = props;
117118

118119
let [hasOverflow, setHasOverflow] = useValueEffect(false);
@@ -165,6 +166,7 @@ export const ButtonGroup = forwardRef(function ButtonGroup(props: ButtonGroupPro
165166
let context = {styles: style({flexShrink: 0}), size, isDisabled};
166167
return (
167168
<div
169+
{...filterDOMProps(otherProps)}
168170
ref={domRef}
169171
style={props.UNSAFE_style}
170172
className={(props.UNSAFE_className || '') + buttongroup({

0 commit comments

Comments
 (0)