Bug 32999 - Click handler to show QR code in OPAC lacks preventDefault
Summary: Click handler to show QR code in OPAC lacks preventDefault
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial (vote)
Assignee: Owen Leonard
QA Contact: Kyle M Hall
URL:
Keywords:
Depends on: 23566
Blocks:
  Show dependency treegraph
 
Reported: 2023-02-17 16:06 UTC by Owen Leonard
Modified: 2023-12-28 20:43 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.04,22.05.11, 21.11.19


Attachments
Bug 32999: Click handler to show QR code in OPAC lacks preventDefault (1.65 KB, patch)
2023-02-17 16:22 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 32999: Click handler to show QR code in OPAC lacks preventDefault (1.70 KB, patch)
2023-02-17 16:50 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 32999: Click handler to show QR code in OPAC lacks preventDefault (1.75 KB, patch)
2023-02-17 18:05 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2023-02-17 16:06:58 UTC
If you're scrolled down on the OPAC bibliographic detail page and click the "Send to device" link, the page jumps up to the top because the click handler doesn't have a "return false" or "event.preventDefault()".
Comment 1 Owen Leonard 2023-02-17 16:22:43 UTC
Created attachment 146857 [details] [review]
Bug 32999: Click handler to show QR code in OPAC lacks preventDefault

This patch adds "preventDefault()" to the click handler for showing
the bibliographic detail QR code. This prevents the page from scrolling
to the top when the user clicks the link.

To test, apply the patch and make sure the OPACDetailQRCode system
preference is enabled.

Locate a bibliographic record and view the detail page. If necessary,
reduce the size of your browser window so that you have to scroll down
a bit to bring the "Send to device" menu item into view in the sidebar.
Click the link to confirm that it shows the QR code and that the page
doesn't jump to the top.
Comment 2 Lucas Gass 2023-02-17 16:50:13 UTC
Created attachment 146869 [details] [review]
Bug 32999: Click handler to show QR code in OPAC lacks preventDefault

This patch adds "preventDefault()" to the click handler for showing
the bibliographic detail QR code. This prevents the page from scrolling
to the top when the user clicks the link.

To test, apply the patch and make sure the OPACDetailQRCode system
preference is enabled.

Locate a bibliographic record and view the detail page. If necessary,
reduce the size of your browser window so that you have to scroll down
a bit to bring the "Send to device" menu item into view in the sidebar.
Click the link to confirm that it shows the QR code and that the page
doesn't jump to the top.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 3 Kyle M Hall 2023-02-17 18:05:45 UTC
Created attachment 146900 [details] [review]
Bug 32999: Click handler to show QR code in OPAC lacks preventDefault

This patch adds "preventDefault()" to the click handler for showing
the bibliographic detail QR code. This prevents the page from scrolling
to the top when the user clicks the link.

To test, apply the patch and make sure the OPACDetailQRCode system
preference is enabled.

Locate a bibliographic record and view the detail page. If necessary,
reduce the size of your browser window so that you have to scroll down
a bit to bring the "Send to device" menu item into view in the sidebar.
Click the link to confirm that it shows the QR code and that the page
doesn't jump to the top.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 4 Tomás Cohen Arazi 2023-02-20 12:55:12 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 5 Martin Renvoize 2023-02-24 08:31:53 UTC
Many hands makes light work, thankyou everyone!

Pushed to 22.11.x for the next release
Comment 6 Lucas Gass 2023-03-01 14:46:38 UTC
Backported to 22.05.x for upcoming 22.05.11
Comment 7 Arthur Suzuki 2023-03-29 09:20:48 UTC
applied to 21.11.x for 21.11.19
Comment 8 wainuiwitikapark 2023-04-27 04:28:53 UTC
Not backported to 21.05.x