Add methods for clearing selections

This commit is contained in:
John Factotum
2023-03-08 11:02:17 +00:00
committed by GitHub
parent ac4e3962df
commit 1fef33731f
2 changed files with 7 additions and 0 deletions
+4
View File
@@ -653,6 +653,10 @@ export class Paginator {
const $style = this.#styleMap.get(this.#view?.document)
if ($style) $style.textContent = style
}
deselect() {
const sel = this.#view.document.defaultView.getSelection()
sel.removeAllRanges()
}
async #setAnchor(anchor, select) {
this.#anchor = anchor
await this.#scrollToAnchor(select)