Giter Site home page Giter Site logo

Comments (3)

johnfactotum avatar johnfactotum commented on August 12, 2024
  1. Indeed, this is something that really bugs me as well. Currently highlighting depends on the selected event in Epub.js -- I got the impression that this is the intended way to do highlights as this is what's used in their example, and somehow the the event is set to fire after a timeout rather than on mouseup. We should probably file an issue to them as well.
  2. I haven't really considered this point. The main point of the current behavior, I suppose, is that the popover would not obstruct the text. The travel distance isn't that much, in my opinion.

So I think a more desirable behavior might be to

  1. Keep the current behavior, just make the event fire only after mouseup; or
  2. Keep the current behavior, fix event trigger, but don't auto-highlight; instead, show a "highlight" button in the popover; or
  3. Don't do anything on selection; instead, show the popover only on right click

I think if the popover is triggered by selection, it should try its best not to obstruct the selection. If it's triggered by right click, like a context menu, then I agree, it should follow the cursor.

from foliate.

SonephetR2 avatar SonephetR2 commented on August 12, 2024

Regarding point 1, I just opened the thread here. Hope this helps.

Point 2. is obviously very minor. Not obstructing the text is obviously completely critical whereas minimizing travel distance when already relatively short is a luxury.

I'd vastly prefer behaviour no. 1 over the two others (especially behaviour no. 2, which I feel would be nearly as frustrating as the current behaviour). Behaviour no. 3 would be a good cop-out though it would probably then be ideal to have a customisable keyboard shortcut for the highlighter tool (or even one per colour) to give users a quicker option.

from foliate.

johnfactotum avatar johnfactotum commented on August 12, 2024

Thanks for opening that issue.

I've considered not auto-highlighting because sometimes you might just want to copy or do some other action such as dictionary/translation or search, but without highlighting. Obviously this depends on which functionality you use more often. But this can be easily solved by adding a preference.

The biggest problem is still the annoying event behaviour. I'll look into workarounds if I have the time. Or we'll just wait for upstream to respond.

from foliate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.