File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,13 @@ import Action from '../components/Action';
5
5
import { emptySnapshots } from '../actions/actions' ;
6
6
import { useStoreContext } from '../store' ;
7
7
8
+ const resetSlider = ( ) => {
9
+ console . log ( 'in reset slider' ) ;
10
+ const slider = document . querySelector ( '.rc-slider-handle' ) ;
11
+ console . log ( 'my slider' , slider ) ;
12
+ slider . setAttribute ( 'style' , 'left: 0' ) ;
13
+ } ;
14
+
8
15
function ActionContainer ( ) {
9
16
const [ { tabs, currentTab } , dispatch ] = useStoreContext ( ) ;
10
17
const { snapshots, sliderIndex, viewIndex } = tabs [ currentTab ] ;
@@ -28,7 +35,15 @@ function ActionContainer() {
28
35
return (
29
36
< div className = "action-container" >
30
37
< div className = "action-component exclude" >
31
- < button className = "empty-button" onClick = { ( ) => dispatch ( emptySnapshots ( ) ) } type = "button" >
38
+ < button
39
+ className = "empty-button"
40
+ onClick = { ( ) => {
41
+ dispatch ( emptySnapshots ( ) ) ;
42
+ // set slider back to zero
43
+ resetSlider ( ) ;
44
+ } }
45
+ type = "button"
46
+ >
32
47
Empty
33
48
</ button >
34
49
</ div >
You can’t perform that action at this time.
0 commit comments