diff --git a/change/@fluentui-react-slider-2f917409-4eb9-4200-a537-14c6a2e11be2.json b/change/@fluentui-react-slider-2f917409-4eb9-4200-a537-14c6a2e11be2.json new file mode 100644 index 0000000000000..a0e46971a9971 --- /dev/null +++ b/change/@fluentui-react-slider-2f917409-4eb9-4200-a537-14c6a2e11be2.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "fix: allow refs passed in root slot to merge with focus refs", + "packageName": "@fluentui/react-slider", + "email": "mgodbolt@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-components/react-slider/src/components/Slider/useSlider.ts b/packages/react-components/react-slider/src/components/Slider/useSlider.ts index 8797b52625c05..90d6a32b29156 100644 --- a/packages/react-components/react-slider/src/components/Slider/useSlider.ts +++ b/packages/react-components/react-slider/src/components/Slider/useSlider.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import { getPartitionedNativeProps, resolveShorthand, useId } from '@fluentui/react-utilities'; +import { getPartitionedNativeProps, resolveShorthand, useId, useMergedRefs } from '@fluentui/react-utilities'; import { useSliderState_unstable } from './useSliderState'; import { SliderProps, SliderState } from './Slider.types'; import { useFocusWithin } from '@fluentui/react-tabster'; @@ -34,10 +34,7 @@ export const useSlider_unstable = (props: SliderProps, ref: React.Ref(), - ...nativeProps.root, - }, + defaultProps: nativeProps.root, }), input: resolveShorthand(input, { required: true, @@ -53,6 +50,8 @@ export const useSlider_unstable = (props: SliderProps, ref: React.Ref()); + useSliderState_unstable(state, props); return state;