nukeop / nuclear

Streaming music player that finds free music for you
https://nuclear.js.org/
GNU Affero General Public License v3.0
12.02k stars 1.04k forks source link

Uncontrolled middle click behavior. #1619

Closed CarlosBor closed 2 weeks ago

CarlosBor commented 3 months ago

Platform: Windows

Nuclear version: 0.6.30

Description of the issue: When using the middle mouse button to click on left sidebar elements a blank window is opened: image When clicking history buttons, it actually opens a new instance of nuclear, which window controls (close, maximize, minimize) actually take effect on the original window

I'm not aware of any present functionality pressing the middle mouse button has on the app, perhaps capturing every instance of that action and ignoring it or treating it as a left-click would be an easy fix?

nukeop commented 3 months ago

Also reproduces on Mac. I guess this is because it's trying to open the URL in a new tab by default or something. It should be pretty easy to just disable this altogether.

sean-mongey commented 3 months ago

Hi Carlos. I was wondering if I could take a look at solving this

CarlosBor commented 2 months ago

As far as I am concerned, sure thing, I'm not currently working on it or anything.

I don't get to assign contributors but I'm sure you'll have no problem.

nukeop commented 2 months ago

This can likely be easily solved by using the auxclick event. You can assign a click handler with preventDefault to it: https://developer.mozilla.org/en-US/docs/Web/API/Element/auxclick_event