Skip to content

Commit 584ebf6

Browse files
committed
fix highlight hiding bug
1 parent 534a296 commit 584ebf6

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/annotator/highlighter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ export function setHighlightsFocused(highlights, focused) {
357357
export function setHighlightsVisible(root, visible) {
358358
const showHighlightsClass = 'hypothesis-highlights-always-on';
359359
root.classList.toggle(showHighlightsClass, visible);
360+
root.classList.toggle('hypothesis-highlights-hidden', !visible);
360361
}
361362

362363
/**

src/styles/annotator/highlights.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
fill: transparent;
77
}
88

9+
.hypothesis-highlights-hidden {
10+
.hypothesis-highlight {
11+
background-color: transparent !important;
12+
}
13+
}
14+
915
// `hypothesis-highlights-always-on` is a class that is toggled on the root
1016
// of the annotated document when highlights are enabled/disabled.
1117
.hypothesis-highlights-always-on {

0 commit comments

Comments
 (0)