Skip to content

Commit 18560c4

Browse files
Reset selection appearance after deselecting text, instead of just before
1 parent be63cf0 commit 18560c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

highlight-helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,12 +479,12 @@ function Highlighter(options = hhDefaultOptions) {
479479
this.deactivateHighlights = (removeSelectionRanges = true) => {
480480
const deactivatedHighlight = highlightsById[activeHighlightId];
481481
activeHighlightId = null;
482-
updateSelectionUi('appearance');
483482
previousSelectionRange = null;
484483
const selection = window.getSelection();
485484
if (removeSelectionRanges && selection.anchorNode && this.annotatableContainer.contains(selection.anchorNode)) {
486485
selection.collapseToStart();
487486
}
487+
updateSelectionUi('appearance');
488488
if (deactivatedHighlight) {
489489
this.annotatableContainer.dispatchEvent(new CustomEvent('hh:highlightdeactivate', { detail: {
490490
highlight: deactivatedHighlight,

0 commit comments

Comments
 (0)