fix: use onchange instead of oninput for checkbox/select elements (fixes #1000)#1008
Open
wahajahmed010 wants to merge 1 commit into
Open
fix: use onchange instead of oninput for checkbox/select elements (fixes #1000)#1008wahajahmed010 wants to merge 1 commit into
wahajahmed010 wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.oninputevent handlers for:<input type="checkbox">elements (service enable toggles like DeepL)<select>dropdown elements ("useAlternativeService", "enableDiskCache")The
inputevent 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
.oninputto.onchangefor all affected elements:#useAlternativeService(select)#btnEnableGoogle,#btnEnableBing,#btnEnableYandex,#btnEnableDeepL(checkboxes)#enableDiskCache(select)onchangeis 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
.onchange.AI-assisted
This fix was identified and implemented with AI assistance.
Fixes #1000