Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

word selection issue #187

Open
singhranakumar22gmailcom opened this issue Jun 28, 2021 · 7 comments
Open

word selection issue #187

singhranakumar22gmailcom opened this issue Jun 28, 2021 · 7 comments

Comments

@singhranakumar22gmailcom

i am useing readium library for epub .when i am holding on the first word then it's getting selected and when i am touching and holding on second word then it's get selected with previous one ,like whole sentence get's selected.

word selection issue

  • r2-shared-swift:
  • r2-streamer-swift:
  • r2-navigator-swift:
  • r2-opds-swift:
  • r2-lcp-swift:

macOS: 11.2
platform: x86_64
Xcode 12.4
Build version 12D4e

iOS version: 14.4
Model (e.g. iPhone 11 Pro Max): iPhone 12 Pro Max
Is it an emulator? Yes

in utility.js

 document.addEventListener('selectionchange', debounce(50, function() {
        var info = {}
        var selection = document.getSelection();
       if (selection && selection.rangeCount > 0) {
            var rect = selection.getRangeAt(0).getBoundingClientRect();
            info['text'] = selection.toString().trim();
            info['frame'] = {
                'x': rect.left,
                'y': rect.top,
                'width': rect.width,
                'height': rect.height
            };
        }

        webkit.messageHandlers.selectionChanged.postMessage(info);
    }));
@mickael-menu
Copy link
Member

mickael-menu commented Jul 1, 2021

I'm not sure what's going on, could you record a screencast showing the problem to lift any ambiguity?

And did you reproduce this on a real device?

We don't modify the web view selection in Readium.

Screen.Recording.2021-07-01.at.13.59.03.mov

@singhranakumar22gmailcom
Copy link
Author

Screen.Recording.2021-07-01.at.8.05.53.PM.mov

in real device also it's working same.

@mickael-menu
Copy link
Member

Yeah it looks really buggy but it seems pretty specific to this book. Can you reproduce the problem with one of the books in the sample test app?

@singhranakumar22gmailcom
Copy link
Author

Hii , can u please share the link of your sample test app.

@singhranakumar22gmailcom
Copy link
Author

These are epub files, can u please share the simple Xcode project.

@mickael-menu
Copy link
Member

It's in the same repo. But I asked to see if you had the same problem in your app with one of these sample books.

@readium readium deleted a comment from ktech643 Jul 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants