When middle-clicking or ctrl-clicking a title in the results screen of the staff client, Firefox opens two new tabs. To reproduce: 1. Use a relatively recent version of Firefox (I've tested this on 68esr and 69) 2. Search for an item in the staff interface 3. From the results screen, middle click or control click a title. 4. Depending on your Firefox settings, Firefox will open an new window and a new tab or two new tabs. The popup blocker may also block the opening of these tabs. This appears to be related to the preventdefault() being used here, which Firefox handles differently than other browsers. There's the broader discussion of whether there's any need to use preventdefault() here at all. From the comments in the jquery it appears that someone thought it wasn't a good idea.
I've noticed this before too, but have never taken a hard look at a solution. It has something to do with the click handler added by the "browse search results" buttons.
I just tested and things seem to work ok now - please reopen if you can still see the buggy behavior!
Still happens for me
Created attachment 102089 [details] [review] Bug 23601: Prevent default for auxclick The issue appears to be that the default action is not prevented for middle click because it registers an 'auxclick' event as opposed to a 'click' event To test: 1 - Perform a search in staff client 2 - Shift-click and hold on a result 3 - Note a new tab opens 4 - Release the click, no change 5 - Middle click and hold on a result 6 - New tab opens 7 - Release, a second new tab opens 8 - Apply patch 9 - Reload page 10 - Middle click and hold 11 - New tab opens 12 - Release 13 - No new tab
Thx Nick!
Created attachment 102102 [details] [review] Bug 23601: Prevent default for auxclick The issue appears to be that the default action is not prevented for middle click because it registers an 'auxclick' event as opposed to a 'click' event To test: 1 - Perform a search in staff client 2 - Shift-click and hold on a result 3 - Note a new tab opens 4 - Release the click, no change 5 - Middle click and hold on a result 6 - New tab opens 7 - Release, a second new tab opens 8 - Apply patch 9 - Reload page 10 - Middle click and hold 11 - New tab opens 12 - Release 13 - No new tab Signed-off-by: David Nind <david@davidnind.com>
Tested on Ubuntu 18.04 with Firefox 74.0 and Firefox Developer Edition 75.0b11 (64-bit editions).
I cannot recreate that (Firefox 68.4.1esr)
(In reply to Jonathan Druart from comment #8) > I cannot recreate that (Firefox 68.4.1esr) I do on Firefox 74.0
(In reply to Nick Clemens from comment #9) > (In reply to Jonathan Druart from comment #8) > > I cannot recreate that (Firefox 68.4.1esr) > > I do on Firefox 74.0 Wait, I actually do! Lucky me!
Created attachment 102141 [details] [review] Bug 23601: Prevent default for auxclick The issue appears to be that the default action is not prevented for middle click because it registers an 'auxclick' event as opposed to a 'click' event To test: 1 - Perform a search in staff client 2 - Shift-click and hold on a result 3 - Note a new tab opens 4 - Release the click, no change 5 - Middle click and hold on a result 6 - New tab opens 7 - Release, a second new tab opens 8 - Apply patch 9 - Reload page 10 - Middle click and hold 11 - New tab opens 12 - Release 13 - No new tab Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Let's do fix that correctly, please? See bug 25027.
Nice work everyone! Pushed to master for 20.05
backported to 19.11.x for 19.11.06
backported to 19.05.x for 19.05.11