fix(reader): enable text copy in ebook reader (#2700) (#2702)

This commit is contained in:
ACX
2026-02-11 17:14:44 -07:00
committed by GitHub
parent 9ed6a3fe72
commit c1e0c721f7
2 changed files with 4 additions and 7 deletions
@@ -228,13 +228,6 @@ export class ReaderEventService {
this.handleTouchEnd(event, doc);
}, {passive: false});
doc.addEventListener('contextmenu', (event: MouseEvent) => {
const selection = doc.defaultView?.getSelection();
if (selection && !selection.isCollapsed) {
event.preventDefault();
}
});
doc.addEventListener('selectionchange', () => {
this.handleSelectionChange(doc);
});
@@ -107,6 +107,10 @@ export class ReaderSelectionService {
if (action.type === 'select') {
this.clearPreview();
if (this.currentSelection?.text) {
navigator.clipboard.writeText(this.currentSelection.text);
}
this.viewManager.clearSelection();
this.emitState();
} else if (action.type === 'search' && action.searchText) {
this.clearPreview();