From c1e0c721f77d9bfc3d508c7c383c6e4fb428059a Mon Sep 17 00:00:00 2001 From: ACX <8075870+acx10@users.noreply.github.com> Date: Wed, 11 Feb 2026 17:14:44 -0700 Subject: [PATCH] fix(reader): enable text copy in ebook reader (#2700) (#2702) --- .../features/readers/ebook-reader/core/event.service.ts | 7 ------- .../ebook-reader/features/selection/selection.service.ts | 4 ++++ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/booklore-ui/src/app/features/readers/ebook-reader/core/event.service.ts b/booklore-ui/src/app/features/readers/ebook-reader/core/event.service.ts index 5294d8fdd..8b88bbbb9 100644 --- a/booklore-ui/src/app/features/readers/ebook-reader/core/event.service.ts +++ b/booklore-ui/src/app/features/readers/ebook-reader/core/event.service.ts @@ -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); }); diff --git a/booklore-ui/src/app/features/readers/ebook-reader/features/selection/selection.service.ts b/booklore-ui/src/app/features/readers/ebook-reader/features/selection/selection.service.ts index 0b4d24979..117efbc6f 100644 --- a/booklore-ui/src/app/features/readers/ebook-reader/features/selection/selection.service.ts +++ b/booklore-ui/src/app/features/readers/ebook-reader/features/selection/selection.service.ts @@ -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();