Skip to content

Conversation

@backportbot
Copy link

@backportbot backportbot bot commented Sep 16, 2025

Backport of PR #374

Since jQuery 1.6 the attr() and prop() functions more strictly follow
W3C forms specification. Concretely the following is the current
functionality without going to deep into details:

* attr('checked') will actually check defaultChecked, which is the
  initial state of the checkbox upon page load.
* prop('checked') matches the current state of the checkbox. It will
  change state when the user checks or unchecks the checkbox.

https://api.jquery.com/attr/
https://api.jquery.com/prop/

Concretely current implementation is broken since probably jQuery 1.6 as
observed in devtools requests. The requests when toggling checkboxes
are always sending the on-page-load current value. So if a setting is on
all toggles of the checkbox will always turn the setting on server-side,
making it impossible to actually change the setting.

Switch to prop() function to resolve the issue.

Fixes #121
Fixes #166
Fixes #305

Signed-off-by: Melvin Vermeeren <vermeeren@vermwa.re>
@luka-nextcloud luka-nextcloud merged commit 808fdbd into stable31 Sep 16, 2025
17 of 18 checks passed
@luka-nextcloud luka-nextcloud deleted the backport/374/stable31 branch September 16, 2025 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants