File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -114,11 +114,11 @@ export function useSlider(
114
114
const trackPosition = trackRef . current . getBoundingClientRect ( ) . left ;
115
115
const clickPosition = e . clientX ;
116
116
const offset = clickPosition - trackPosition ;
117
- const percent = offset / trackRef . current . offsetWidth ;
118
- let value = state . getPercentValue ( percent ) ;
117
+ let percent = offset / trackRef . current . offsetWidth ;
119
118
if ( direction === 'rtl' ) {
120
- value = 100 - value ;
119
+ percent = 1 - percent ;
121
120
}
121
+ const value = state . getPercentValue ( percent ) ;
122
122
123
123
// Only compute the diff for thumbs that are editable, as only they can be dragged
124
124
const minDiff = Math . min ( ...state . values . map ( ( v , index ) => state . isThumbEditable ( index ) ? Math . abs ( v - value ) : Number . POSITIVE_INFINITY ) ) ;
Original file line number Diff line number Diff line change 19
19
},
20
20
"dependencies" : {
21
21
"@babel/runtime" : " ^7.6.2" ,
22
+ "@react-aria/interactions" : " 3.2.0" ,
22
23
"@react-aria/utils" : " ^3.1.0" ,
23
- "@react-types/shared " : " ^3.1.0 " ,
24
- "@react-stately/splitview " : " ^3.0.0-alpha.1 "
24
+ "@react-stately/splitview " : " ^3.0.0-alpha.1 " ,
25
+ "@react-types/shared " : " ^3.1.0 "
25
26
},
26
27
"peerDependencies" : {
27
28
"react" : " ^16.8.0"
You can’t perform that action at this time.
0 commit comments