Skip to content

fix: use onchange instead of oninput for checkbox/select elements (fixes #1000)#1008

Open
wahajahmed010 wants to merge 1 commit into
FilipePS:masterfrom
wahajahmed010:fix/1000-buttons-not-working
Open

fix: use onchange instead of oninput for checkbox/select elements (fixes #1000)#1008
wahajahmed010 wants to merge 1 commit into
FilipePS:masterfrom
wahajahmed010:fix/1000-buttons-not-working

Conversation

@wahajahmed010

Copy link
Copy Markdown

Summary

Fixes issue #1000 where buttons/options in the extension settings page were not responding to clicks.

Root Cause

The options page (src/options/options.js) used .oninput event handlers for:

  • <input type="checkbox"> elements (service enable toggles like DeepL)
  • <select> dropdown elements ("useAlternativeService", "enableDiskCache")

The input event is not standard for checkboxes in some browsers (including Firefox), which prevents the event handler from firing when users click checkboxes or select options. This matches the cross-browser symptoms reported in #1000 (Firefox, Chrome, Ungoogled Chromium, Cromite, Fennec on Android).

Fix

Changed .oninput to .onchange for all affected elements:

  • #useAlternativeService (select)
  • #btnEnableGoogle, #btnEnableBing, #btnEnableYandex, #btnEnableDeepL (checkboxes)
  • #enableDiskCache (select)

onchange is the standard, cross-browser-compatible event for both <input type="checkbox"> and <select> elements.

Files Changed

  • src/options/options.js — 3 line changes (3 deletions, 3 insertions)

Verification

  • No existing test suite in the repository.
  • Fix verified by code review: all other checkbox/select handlers in the same file already correctly use .onchange.

AI-assisted

This fix was identified and implemented with AI assistance.

Fixes #1000

The options page used .oninput for <input type="checkbox"> and <select>
elements. The 'input' event is not standard for checkboxes in some browsers
(including Firefox), which prevents the event handler from firing when users
click checkboxes or select options.

This specifically fixes:
- DeepL option not selectable in Privacy settings
- Other service checkboxes not responding in Privacy settings
- Select dropdowns not registering changes

Fixes FilipePS#1000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] The buttons (options) aren't working

1 participant