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

WebUI (file)table broken in current master #10162

Closed
xnoreq opened this issue Jan 14, 2019 · 5 comments · Fixed by #10153
Closed

WebUI (file)table broken in current master #10162

xnoreq opened this issue Jan 14, 2019 · 5 comments · Fixed by #10153
Labels
WebUI WebUI-related issues/changes

Comments

@xnoreq
Copy link
Contributor

xnoreq commented Jan 14, 2019

qBittorrent version and Operating System

master (2e5c09a)

If on linux, libtorrent and Qt version

libtorrent 1.1.11
qt 5.12.0
firefox 65

What is the problem

Clicking on the download checkbox of a file in the Content tab in the WebUI does nothing.

Analysis

Please use the firefox web developer inspector to verify this (and also during development to avoid committing such bugs):

The checkbox has a change event:
<input type="checkbox" id="cbPrio0" data-id="0" class="DownloadedCB">

which is embedded in a <tr>.
The <tr> has 2 click and 2 contextmenu events. This already is dubious.

One of the event handlers executes this:

tr.addEvent('click', function(e) {
e.stop();

So when I click the checkbox, the tr-click handler stops the event first, so the checkbox changed handler is never called:

checkbox.addEvent('change', fileCheckboxChanged);

var fileCheckboxChanged = function(e) {

@xnoreq
Copy link
Contributor Author

xnoreq commented Jan 14, 2019

One easy way to fix this is to add a click event handler to the input box which calls event.stopPropagation() first (prevents the th click handler from being called).

And the tr click handler already returns false which is equivalent to calling e.preventDefault() which is fine I guess.

edit: it's not just an easy fix, it is more correct than using the change event. The change event on a checkbox has the weird official definition to only fire if the checked stated changed and the checkbox loses focus.

@thalieht thalieht added the WebUI WebUI-related issues/changes label Jan 14, 2019
@xnoreq
Copy link
Contributor Author

xnoreq commented Jan 14, 2019

xnoreq@ea1a337

@Chocobo1
Copy link
Member

Ping @Piccirello.

@Piccirello
Copy link
Member

Confirmed this issue was introduced in #10006. Looks like #10153 is also affected.

@xnoreq thanks for reporting this and quickly posting a fix. I've integrated your patch into #10153 since that PR should be merged before the next release.

@Arathen
Copy link

Arathen commented Mar 20, 2019

It has been a couple of months and this is still broken. Is @Piccirello the only one who can update #10153 so that its suitable for merging? He looks like he's had other commitments on his time lately.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
WebUI WebUI-related issues/changes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants