Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Torrent right-click context menu jumps to top left on taphold (touch pad and touch devices) #8

Closed
SamiJ opened this issue Jul 25, 2021 · 0 comments

Comments

@SamiJ
Copy link

SamiJ commented Jul 25, 2021

Hi folks,
Good job with BiglyBT, loving it on my Shield TV setup.

I did run into a small bug when accessing BiglyBT via the remote client. On Chrome v91 running on MacOS v11.5, using touchpad right click causes the context menu to first appear briefly on the correct spot - at the cursor - after which it immediately jumps to top left.

Digging further, touchpads seems to trigger a mouseEvent first, followed by a taphold event. The jQuery taphold event doesn't seem to have the pageX / pageY props for positioning, so the context menu jumps to the default position.

This can be reproduced with any taphold action, e.g. by pressing a mouse button for 1s+ on top of a torrent.

This can be fixed by using the original event (which does have the coords) instead of the jQuery one.
Adding the following invocation to context menu options in transmission.js does the trick:

$("ul#torrent_list").contextmenu({
    // ...
    position: function (event) {
        // Use originalEvent positioning for better taphold support on touch devices
            return { of: event.originalEvent }
        },
    // ...
SamiJ added a commit to SamiJ/BiglyBT-plugin-xmwebui that referenced this issue Jul 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant