Skip to content

fix(QToggle): add high contrast mode support for toggle visibility#18303

Open
ruguoba wants to merge 2 commits into
quasarframework:devfrom
ruguoba:fix/qtoggle-high-contrast
Open

fix(QToggle): add high contrast mode support for toggle visibility#18303
ruguoba wants to merge 2 commits into
quasarframework:devfrom
ruguoba:fix/qtoggle-high-contrast

Conversation

@ruguoba
Copy link
Copy Markdown

@ruguoba ruguoba commented May 14, 2026

Problem

Toggle buttons are not visible in Windows high contrast mode. Users with low vision or those who rely on high contrast settings cannot see or interact with toggle controls.

Fixes #18242

Root Cause

The QToggle component's CSS doesn't include support for Windows high contrast mode (forced-colors: active). In high contrast mode, browsers override certain CSS properties, but components that rely on subtle visual differences (like opacity and box-shadow) may become invisible.

Fix

Add CSS rules for the @media (forced-colors: active) media query to ensure toggle components are visible and accessible in high contrast mode:

  • Track: Uses ButtonText border and Canvas background for clear visibility
  • Thumb: Uses ButtonText background for clear contrast
  • Truth state: Uses Highlight and HighlightText system colors for the active state
  • Disabled state: Uses GrayText system color for disabled elements

This follows the CSS System Colors specification and ensures the toggle is accessible across all high contrast themes.

ruguoba added 2 commits May 14, 2026 17:08
When v-model.trim is used with @update:model-value, typing a space
immediately trims the input value. This happens because the model
watcher updates innerValue with the trimmed value, which forces
the input DOM to sync.

Fix: skip updating innerValue when the input has focus and the
new model value matches the current input value after trimming.
This preserves the user's typed characters (including spaces)
while still keeping the model value trimmed.

Fixes quasarframework#18294
Toggle buttons are not visible in Windows high contrast mode.
Add CSS for forced-colors media query to ensure toggle
components are visible and accessible.

Fixes quasarframework#18242
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.

In high contrast modes toggle buttons are not visible.

1 participant