File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
src/Common/SegmentedControl Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { ComponentSizeType } from '@Shared/constants'
4
4
import { Tooltip } from '@Common/Tooltip'
5
5
import { SegmentProps , SegmentType } from './types'
6
6
import { COMPONENT_SIZE_TO_ICON_CLASS_MAP , COMPONENT_SIZE_TO_SEGMENT_CLASS_MAP } from './constants'
7
- import { ConditionalWrap } from '..'
7
+ import { ConditionalWrap } from '../Helper '
8
8
9
9
const wrapWithTooltip = ( tooltipProps : SegmentType [ 'tooltipProps' ] ) => ( children : ReactElement ) => (
10
10
< Tooltip content = { tooltipProps . content } placement = "bottom" { ...tooltipProps } alwaysShowTippyOnHover >
Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ const SegmentedControl = ({
16
16
const isUnControlledComponent = controlledValue === undefined
17
17
18
18
const segmentedControlRefContainer = useRef < HTMLDivElement > ( null )
19
+ /**
20
+ * Using this ref to show the selected segment highlight with transition
21
+ */
19
22
const selectedSegmentRef = useRef < HTMLDivElement > ( null )
20
23
const [ selectedSegmentValue , setSelectedSegmentValue ] = useState < SegmentType [ 'value' ] | null > ( segments [ 0 ] . value )
21
24
const segmentValue = isUnControlledComponent ? selectedSegmentValue : controlledValue
You can’t perform that action at this time.
0 commit comments