File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ function History(props: Record<string, unknown>) {
110
110
// .join("g")
111
111
. attr ( 'transform' , d => `translate(${ d . x } ,${ d . y } )` ) ;
112
112
113
+
113
114
node . append ( 'circle' )
114
115
. attr ( 'fill' , d => {
115
116
if ( d . data . index === currLocation . index ) {
@@ -121,6 +122,8 @@ function History(props: Record<string, unknown>) {
121
122
. style ( 'cursor' , 'pointer' )
122
123
. on ( 'click' , d => {
123
124
console . log ( 'DEBUG >>> onclick d:' , d ) ;
125
+ console . log ( 'DEBUG >>> Clicked on currlocation:' , currLocation ) ;
126
+ console . log ( 'DEBUG >>> Clicked on d.data:' , d . data . index ) ;
124
127
dispatch ( changeView ( d . data . index ) ) ;
125
128
dispatch ( changeSlider ( d . data . index ) ) ;
126
129
} )
Original file line number Diff line number Diff line change @@ -134,19 +134,19 @@ function ActionContainer(props) {
134
134
function handleOnKeyDown ( e : KeyboardEvent , i : number ) {
135
135
let currIndex = i ;
136
136
// up arrow key pressed
137
- if ( e . keyCode === 38 ) {
137
+ if ( e . key === 'ArrowUp' ) {
138
138
currIndex -= 1 ;
139
139
if ( currIndex < 0 ) return ;
140
140
dispatch ( changeView ( currIndex ) ) ;
141
141
}
142
142
// down arrow key pressed
143
- else if ( e . keyCode === 40 ) {
143
+ else if ( e . key === 'ArrowDown' ) {
144
144
currIndex += 1 ;
145
145
if ( currIndex > hierarchyArr . length - 1 ) return ;
146
146
dispatch ( changeView ( currIndex ) ) ;
147
147
}
148
148
// enter key pressed
149
- else if ( e . keyCode === 13 ) {
149
+ else if ( e . key === 'Enter' ) {
150
150
e . stopPropagation ( ) ;
151
151
e . preventDefault ( ) ; // needed or will trigger onClick right after
152
152
dispatch ( changeSlider ( currIndex ) ) ;
You can’t perform that action at this time.
0 commit comments