From f6a0e6f3e4e4cfa7b41fc07fb2e0cd44a0e8e3cf Mon Sep 17 00:00:00 2001 From: Micah Godbolt Date: Fri, 6 Jan 2023 14:32:59 -0800 Subject: [PATCH 1/3] fix: allow refs passed in root slot to merge with focus refs --- .../react-slider/src/components/Slider/useSlider.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 8797b52625c058..141b295dec2805 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'; @@ -35,7 +35,6 @@ export const useSlider_unstable = (props: SliderProps, ref: React.Ref(), ...nativeProps.root, }, }), @@ -53,6 +52,8 @@ export const useSlider_unstable = (props: SliderProps, ref: React.Ref()); + useSliderState_unstable(state, props); return state; From 2d488a1c44924386159a3517be97f08b94dbe3d1 Mon Sep 17 00:00:00 2001 From: Micah Godbolt Date: Fri, 6 Jan 2023 14:37:18 -0800 Subject: [PATCH 2/3] change file --- ...-react-slider-2f917409-4eb9-4200-a537-14c6a2e11be2.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/@fluentui-react-slider-2f917409-4eb9-4200-a537-14c6a2e11be2.json 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 00000000000000..a0e46971a99713 --- /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" +} From 8dc87756085602f39d5dabf8cd0e732ffe222512 Mon Sep 17 00:00:00 2001 From: Micah Godbolt Date: Fri, 6 Jan 2023 14:52:16 -0800 Subject: [PATCH 3/3] cleanup --- .../react-slider/src/components/Slider/useSlider.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 141b295dec2805..90d6a32b291566 100644 --- a/packages/react-components/react-slider/src/components/Slider/useSlider.ts +++ b/packages/react-components/react-slider/src/components/Slider/useSlider.ts @@ -34,9 +34,7 @@ export const useSlider_unstable = (props: SliderProps, ref: React.Ref