Page MenuHomePhabricator

Clicking on dark mode radio button and scrolling up/down results in flashing colours
Closed, ResolvedPublic2 Estimated Story PointsBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:
Rapidly flashing colours, not ideal for those with epilepsy.

This should be fixed quickly, since it is common for people to scroll down pages with the down arrow

What should have happened instead?:

Some kind of prevention from scrolling down the radio buttons, or at least a delay. Noting this task is based on VRT ticket 2025081910001287.

A workaround is to put the following in common.js by the way:

var disableArrowKeys = function(e){
    if($("input[name='skin-client-pref-skin-theme-group']").is(':focus')){
        if(e.keyCode==37){
            e.preventDefault();
            window.scrollBy(-100, 0);
        }
        else if(e.keyCode==38){
            e.preventDefault();
            window.scrollBy(0, -100);
        }
        else if(e.keyCode==39){
            e.preventDefault();
            window.scrollBy(100, 0);
        }
        else if(e.keyCode==40){
            e.preventDefault();
            window.scrollBy(0, 100);
        }
    }
}
$(document).keydown(disableArrowKeys);

Requirement

Scope: Desktop web (Vector 2022).

  • When a user selects a dark mode radio button under “Appearance > Color,” holding or pressing the arrow keys must not trigger rapid flashing or color changes.
  • The interface must prevent repeated toggling or re-rendering of color modes while scrolling or navigating with arrow keys.
  • Implement a delay or disable input repetition to ensure stable transition between modes.
  • The fix must eliminate flashing effects that may cause accessibility issues (e.g., for users with photosensitivity or epilepsy).

BDD

Feature: Prevent flashing when scrolling after dark mode selection

  Scenario: User selects dark mode and scrolls with arrow keys
    Given I am using Vector 2022 on desktop
    And I open “Appearance > Color” settings
    When I click the “Dark” radio button
    And hold the down arrow key to scroll
    Then the page does not flash or rapidly change colors
    And the dark mode remains stable until I release the key or select another option

Test Steps

Test Case 1: Prevent flashing when scrolling after selecting dark mode

  1. Open https://en.wikipedia.org/wiki/Main_Page using Vector 2022.
  2. Go to “Appearance > Color” in the settings menu.
  3. Click the “Dark” radio button.
  4. Hold the down arrow key to scroll.
  5. AC1: No rapid flashing or flickering occurs while scrolling.
  6. AC2: The dark mode remains applied consistently.
  7. AC3: The UI remains responsive and accessible (no frozen or jittery transitions).

QA Results - Beta

ACStatusDetails
1T402285#11283835
2T402285#11283835
3T402285#11283835

QA Results - Prod

ACStatusDetails
1T402285#11283842
2T402285#11283842
3T402285#11283842

Event Timeline

Matrix triaged this task as High priority.Aug 19 2025, 11:10 AM

High priority since it's a safety risk

Aklapper raised the priority of this task from High to Needs Triage.Aug 19 2025, 12:02 PM
Aklapper added a project: Vector 2022.

Thanks for reporting! I'm resetting priority - feel free to set it if you plan to work on fixing this task. Thanks!
Indeed, probably a slower progression between colors would be welcome.

Thanks for this task @Matrix, but I'm wondering in what scenario someone would execute the following steps:

  1. Open the Appearance menu
  2. Change the dark/light mode setting
  3. Then press and hold down arrow key

I realize lots of people use the down arrow to scroll, but this abrupt change only happens if you hold the down the arrow key right after changing the setting, while the dropdown is open. Additionally, the ability to change that setting with the arrow keys is implemented to provide keyboard accessibility, so I'm wondering if the suggested fix would actually disable that functionality.

I'm curious what VRT ticket 2025081910001287 is.

Thanks for the comment @Jdrewniak, there is a scenario that someone would do this:

  • They just went to a page maybe by clicking a link somewhere, and see it is in light mode
  • They click dark mode
  • They now want to scroll down the article with the down arrow, but forgot to click back, which can happen

The code above is a workaround, not a fix. The better option would be to have a delay (1-2s) between switching modes when someone holds arrow key. This would keep keyboard accessibility.

VRT ticket 2025081910001287 is just a person complaining to us about it at https://meta.wikimedia.org/wiki/Volunteer_Response_Team, so I filed a task.

Change #1189347 had a related patch set uploaded (by Aude; author: Aude):

[mediawiki/skins/Vector@master] POC - Remove focus (blur) after mouse clicks on radio appearance options

https://gerrit.wikimedia.org/r/1189347

Change #1189520 had a related patch set uploaded (by LorenMora; author: LorenMora):

[mediawiki/skins/Vector@master] POC Use event.repeat to prevent infinite keyhold events

https://gerrit.wikimedia.org/r/1189520

Change #1189520 abandoned by LorenMora:

[mediawiki/skins/Vector@master] POC Use event.repeat to prevent infinite keyhold events

Reason:

just a poc

https://gerrit.wikimedia.org/r/1189520

Change #1189347 abandoned by Aude:

[mediawiki/skins/Vector@master] POC - Remove focus (blur) after mouse clicks on radio appearance options

https://gerrit.wikimedia.org/r/1189347

aude set the point value for this task to 2.Oct 1 2025, 5:01 PM
aude moved this task from Needs refinement to Ready for sprint on the Reader Experience Team board.

Change #1189520 restored by LorenMora:

[mediawiki/skins/Vector@master] POC Use event.repeat to prevent infinite keyhold events

https://gerrit.wikimedia.org/r/1189520

Change #1189520 abandoned by LorenMora:

[mediawiki/skins/Vector@master] POC Use event.repeat to prevent infinite keyhold events

https://gerrit.wikimedia.org/r/1189520

Change #1194746 had a related patch set uploaded (by LorenMora; author: LorenMora):

[mediawiki/skins/Vector@master] Prevent flashing colors from holding down arrow keys

https://gerrit.wikimedia.org/r/1194746

SToyofuku-WMF lowered the priority of this task from High to Medium.Oct 9 2025, 3:05 PM

Lowering priority in the context of the sprint since it's not reading lists

Change #1194746 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Prevent flashing colors from holding down arrow keys

https://gerrit.wikimedia.org/r/1194746

Assigning things to you as they're in the QA column (lmk if anything feels untestable!)

Edtadros subscribed.

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Tahoe 26.x
Browser: Chrome Canary (latest as of test date)
Device: MS
Emulated Device: NA

Test Case 1: Prevent flashing when scrolling after selecting dark mode

  1. Open https://en.wikipedia.org/wiki/Main_Page using Vector 2022.
  2. Go to “Appearance > Color” in the settings menu.
  3. Click the “Dark” radio button.
  4. Hold the down arrow key to scroll.
  5. AC1: No rapid flashing or flickering occurs while scrolling.
  6. AC2: The dark mode remains applied consistently.
  7. AC3: The UI remains responsive and accessible (no frozen or jittery transitions).

screenshot 118.mov.gif (820×1 px, 567 KB)

Test Result - Prod

Status: ✅ PASS
Environment: enwiki
OS: macOS Tahoe 26.x
Browser: Chrome Canary (latest as of test date)
Device: MS
Emulated Device: NA

Test Case 1: Prevent flashing when scrolling after selecting dark mode

  1. Open https://en.wikipedia.org/wiki/Main_Page using Vector 2022.
  2. Go to “Appearance > Color” in the settings menu.
  3. Click the “Dark” radio button.
  4. Hold the down arrow key to scroll.
  5. AC1: No rapid flashing or flickering occurs while scrolling.
  6. AC2: The dark mode remains applied consistently.
  7. AC3: The UI remains responsive and accessible (no frozen or jittery transitions).

screenshot 119.mov.gif (820×1 px, 845 KB)

HFan-WMF claimed this task.
HFan-WMF subscribed.

Also verified as fixed in both production and beta! Now, a user needs to tap the down or up arrows rapidly with releases in between each tap in order to get the color to flash quickly. Holding down the key no longer cycles.