luci-app-package-manager: fix 'autoremove' checkbox uneditable
authorLiangbin Lian <[email protected]>
Thu, 26 Jun 2025 09:09:01 +0000 (17:09 +0800)
committerPaul Donald <[email protected]>
Tue, 7 Oct 2025 16:12:53 +0000 (18:12 +0200)
In HTML, the following lines of code are equivalent:
```
<input disabled />
<input disabled="true" />
<input disabled="false" />
<input disabled="any" />
```
If you want to cancel the 'disabled' flag, you must completely remove it from the HTML instead of assigning a value.

Signed-off-by: Liangbin Lian <[email protected]>
(cherry picked from commit 8b5dfabdf3b4f929ea5e4bbd9350e930c10e8ad3)

applications/luci-app-package-manager/htdocs/luci-static/resources/view/package-manager.js

index 444bd8f63b666165b1d8f44b80d447d4c528f39e..8a70b4bd29ad334810af94f4d0fe8ac5e265c018 100644 (file)
@@ -970,7 +970,7 @@ function handleRemove(ev)
                desc || '',
                E('div', { 'style': 'display:flex; justify-content:space-between; flex-wrap:wrap' }, [
                        E('label', { 'class': 'cbi-checkbox', 'style': 'float:left' }, [
-                               E('input', { 'id': 'autoremove-cb', 'type': 'checkbox', 'checked': 'checked', 'name': 'autoremove', 'disabled': isReadonlyView || L.hasSystemFeature('apk') }), ' ',
+                               E('input', { 'id': 'autoremove-cb', 'type': 'checkbox', 'checked': 'checked', 'name': 'autoremove', 'disabled': isReadonlyView || L.hasSystemFeature('apk') || null }), ' ',
                                E('label', { 'for': 'autoremove-cb' }), ' ',
                                _('Automatically remove unused dependencies')
                        ]),