Mobile: no way to select text at all — request for a proper native-like mobile selection mode
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 30/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- frontend, mobile-dev
Direzione di ricerca
Start by reading PanPluginConfig.defaultMode, PanMode, SelectionPlugin, createTextSelectionHandler, and notifyPage to map how touch input and selection rendering currently interact. Define the mobile selection mode's API and interaction boundaries before implementation. Done should include documented long-press selection, adjustable selection handles, edge auto-scroll, continued one-finger panning, and coverage for the reported visibility and pointer-event cases.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Core ask: long-press to select text on mobile, while still being able to pan/scroll the page — matching how native mobile PDF/document viewers behave. Right now neither is fully possible together.
On touch devices, PanPluginConfig.defaultMode defaults to 'mobile', which auto-activates pan-only mode via the PanMode utility. This means out of the box, mobile users cannot select text at all — dragging on the page only pans/scrolls, since text selection is only enabled for pointerMode by default, and pan mode's own wantsRawTouch:false hands touch gestures entirely to native scrolling.
For an app that needs mobile text selection (copy text, highlight annotations, etc.), this is a significant gap. We tried to work around it ourselves (long-press-to-select-word, then drag handles to extend the selection, like native OS text selection), but ran into real limitations of the current architecture:
- No public API to drive a selection programmatically (only
SelectionPlugin'sprivatebeginSelection/updateSelection/endSelection/selectWorddo this, not meant for external use). - The built-in click-drag selection handler (
createTextSelectionHandler) clears the selection on every newpointerdown, which makes any custom "drag an existing selection's endpoint" gesture built via simulated pointer events fall apart immediately. notifyPage()only renders selection rects whenenabledModesPerDochasshowSelectionRectsconfigured for the currently active interaction mode — sincepanModehas no selection config by default, a selection created viaselectWord()while panning is silently invisible unless you configure this yourself.- Since PDFs are rendered as bitmap/tiles (no native text layer), there's no way to get free native browser text-selection UX (long-press, drag handles, auto-scroll) — everything has to be hand-built against the plugin's internals.
Who else this would help: any embedPDF-based app that targets mobile browsers/PWAs and needs users to copy text or create text-anchored annotations (highlight, underline, comments) — which is a pretty core PDF-viewer use case, not a niche one. Right now those apps either ship mobile as pan-only/read-only (no way to select or annotate text), or have to hand-build the same workaround we did against private internals. A first-class mobile selection mode would remove that whole category of custom, fragile code for anyone building on top of embedPDF.
What we'd love to see: a first-class, documented "mobile selection mode" shipped by the library itself — long-press to select a word, drag handles to extend the selection across lines/pages, with auto-scroll near viewport edges, all while normal one-finger drag still pans the page. Similar to what native OS text views provide.
Happy to share more details about our specific attempt/findings if useful for design discussion.
- Lingua principale
- TypeScript
- Stelle
- 4.5k
- Fork
- 317
- Merge medio
- 10h 16m
- PR unite (30g)
- 174
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di embedpdf/embed-pdf-viewer
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
embedpdf/embed-pdf-viewer#1098 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
embedpdf/embed-pdf-viewer#921 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
embedpdf/embed-pdf-viewer#889 ·
I maintainer di solito rispondono entro 1 giorno
-
[v2] TaskQueue: equal-priority tasks can run out of order when a randomUUID id starts with digitsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
embedpdf/embed-pdf-viewer#874 ·
I maintainer di solito rispondono entro 1 giorno
-
Free text stays scrolled to the caret after editing endsForse già presa @chahore l’ha presa 36 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
embedpdf/embed-pdf-viewer#861 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di embedpdf/embed-pdf-viewer
Issue simili
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
lingdojo/kana-dojo#34223 · 1 commento · 5 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
bug status: needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
mastra-ai/mastra#30587 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area:web p2 product:business triage:active type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
cuadrao-ai/argus#2228 ·
I maintainer di solito rispondono entro 1 giorno
-
.Needs Triage .Team/Metabot Priority:P3 Type:Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
metabase/metabase#87252 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
NuGet registry builds every URL from ROOT_URL, ignoring the host the client usedForse già presa @gritse l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno