Skip to content

Commit 26d655c

Browse files
committed
fix bug where toggle active did not unselect
1 parent 171e00a commit 26d655c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/Alignment/Sentence/Sentence.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const WrappedSentence = ({ n, json, children }) => {
103103
const idMap = buildIdMap(alignedText, sentence);
104104

105105
const toggleActive = ([lnum, wordId]) => {
106-
if (active && active[lnum] && active[lnum].has(wordId)) {
106+
if (active && active.aligned && active.aligned[lnum] && active.aligned[lnum].has(wordId)) {
107107
setActive(null);
108108
} else if (idMap[lnum] && idMap[lnum][wordId]) {
109109
setActive({

0 commit comments

Comments
 (0)