Skip to content

Commit 02ff199

Browse files
Address feedback
1 parent af7f3ea commit 02ff199

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

packages/x-charts-pro/src/ChartZoomSlider/internals/ChartAxisZoomSlider.tsx

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,25 @@ import {
2929
import { ChartAxisZoomSliderThumb } from './ChartAxisZoomSliderThumb';
3030

3131
const ZoomSliderTrack = styled('rect', {
32-
shouldForwardProp: (prop) => shouldForwardProp(prop) && prop !== 'axisDirection',
33-
})<{ axisDirection: 'x' | 'y' }>(({ theme }) => ({
34-
[`&.${chartAxisZoomSliderTrackClasses.root}`]: {
35-
fill:
36-
theme.palette.mode === 'dark'
37-
? (theme.vars || theme).palette.grey[800]
38-
: (theme.vars || theme).palette.grey[300],
39-
cursor: 'pointer',
40-
41-
[`&.${chartAxisZoomSliderTrackClasses.selecting}`]: {
42-
cursor: 'ew-resize',
43-
},
44-
},
32+
shouldForwardProp: (prop) =>
33+
shouldForwardProp(prop) && prop !== 'axisDirection' && prop !== 'isSelecting',
34+
})<{ axisDirection: 'x' | 'y'; isSelecting: boolean }>(({ theme }) => ({
35+
fill:
36+
theme.palette.mode === 'dark'
37+
? (theme.vars || theme).palette.grey[800]
38+
: (theme.vars || theme).palette.grey[300],
39+
cursor: 'pointer',
4540
variants: [
4641
{
47-
props: { axisDirection: 'y' },
42+
props: { axisDirection: 'x', isSelecting: true },
43+
style: {
44+
cursor: 'ew-resize',
45+
},
46+
},
47+
{
48+
props: { axisDirection: 'y', isSelecting: true },
4849
style: {
49-
[`&.${chartAxisZoomSliderTrackClasses.root}.${chartAxisZoomSliderTrackClasses.selecting}`]:
50-
{
51-
cursor: 'ns-resize',
52-
},
50+
cursor: 'ns-resize',
5351
},
5452
},
5553
],
@@ -311,6 +309,7 @@ function ChartAxisZoomSliderTrack({
311309
className={className}
312310
onPointerDown={onPointerDown}
313311
axisDirection={axisDirection}
312+
isSelecting={isSelecting}
314313
{...other}
315314
/>
316315
);

0 commit comments

Comments
 (0)