fix(QToggle): add high contrast mode support for toggle visibility#18303
Open
ruguoba wants to merge 2 commits into
Open
fix(QToggle): add high contrast mode support for toggle visibility#18303ruguoba wants to merge 2 commits into
ruguoba wants to merge 2 commits into
Conversation
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
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.
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:ButtonTextborder andCanvasbackground for clear visibilityButtonTextbackground for clear contrastHighlightandHighlightTextsystem colors for the active stateGrayTextsystem color for disabled elementsThis follows the CSS System Colors specification and ensures the toggle is accessible across all high contrast themes.