Skip to content

Commit 7d44d2a

Browse files
committed
debugging currLocation
1 parent d4e90e3 commit 7d44d2a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/app/components/History.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ function History(props: Record<string, unknown>) {
110110
// .join("g")
111111
.attr('transform', d => `translate(${d.x},${d.y})`);
112112

113+
113114
node.append('circle')
114115
.attr('fill', d => {
115116
if (d.data.index === currLocation.index) {
@@ -121,6 +122,8 @@ function History(props: Record<string, unknown>) {
121122
.style('cursor', 'pointer')
122123
.on('click', d => {
123124
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);
124127
dispatch(changeView(d.data.index));
125128
dispatch(changeSlider(d.data.index));
126129
})

src/app/containers/ActionContainer.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,19 +134,19 @@ function ActionContainer(props) {
134134
function handleOnKeyDown(e: KeyboardEvent, i: number) {
135135
let currIndex = i;
136136
// up arrow key pressed
137-
if (e.keyCode === 38) {
137+
if (e.key === 'ArrowUp') {
138138
currIndex -= 1;
139139
if (currIndex < 0) return;
140140
dispatch(changeView(currIndex));
141141
}
142142
// down arrow key pressed
143-
else if (e.keyCode === 40) {
143+
else if (e.key === 'ArrowDown') {
144144
currIndex += 1;
145145
if (currIndex > hierarchyArr.length - 1) return;
146146
dispatch(changeView(currIndex));
147147
}
148148
// enter key pressed
149-
else if (e.keyCode === 13) {
149+
else if (e.key === 'Enter') {
150150
e.stopPropagation();
151151
e.preventDefault(); // needed or will trigger onClick right after
152152
dispatch(changeSlider(currIndex));

0 commit comments

Comments
 (0)