Skip to content

Conversation

06b
Copy link
Contributor

@06b 06b commented Sep 8, 2025

Description

This relates to the request for High Contrast Support #21515.

When forced-colors is active (such as High Contrast Mode in Windows), in Vuetify 3.9.6 it would render VListItem that is a link with the expected system color for the hyperlink.

Screenshot 2025-09-08 163115

However, due to #21958 in Vuetify 3.9.7 the VListItem renders the incorrect expected system colors for a VListItem that is a link or has no action assigned to it as the button system color.

For example, Content Filtering has no action assigned & Password is a link in the screenshots shown.
Screenshot 2025-09-08 163154

This pull request corrects this mistake when in forced-colors mode.
Screenshot 2025-09-08 164321

Markup:

<template>

  <v-card class="mx-auto" max-width="400">
    <v-toolbar color="purple">
      <v-btn icon="mdi-menu" />
      <v-toolbar-title>Settings</v-toolbar-title>
      <v-btn icon="mdi-magnify" />
    </v-toolbar>

    <v-list lines="three">
      <v-list-subheader>User Controls</v-list-subheader>
      <v-list-item
        v-for="item in userControls"
        :key="item.value"
        :href="item.href"
        :subtitle="item.subtitle"
        :title="item.title"
      >
        <template #prepend>
          <v-avatar>
            <v-icon :icon="item.icon" />
          </v-avatar>
        </template>
      </v-list-item>
    </v-list>

    <v-divider />

    <v-list
      v-model:selected="settingsSelection"
      lines="three"
      select-strategy="leaf"
    >
      <v-list-subheader>General</v-list-subheader>
      <v-list-item
        v-for="item in settingsItems"
        :key="item.value"
        :subtitle="item.subtitle"
        :title="item.title"
        :value="item.value"
      >
        <template #prepend="{ isSelected, select }">
          <v-list-item-action start>
            <v-checkbox-btn
              :model-value="isSelected"
              @update:model-value="select"
            />
          </v-list-item-action>
        </template>
      </v-list-item>
    </v-list>
  </v-card>

</template>

<script>
  export default {
    data: () => ({
      userControls: [
        { title: 'Content filtering', subtitle: 'Set the content filtering level to restrict appts that can be downloaded', icon: 'mdi-filter' },
        { title: 'Password', subtitle: 'Require password for purchase or use password to restrict purchase', icon: 'mdi-form-textbox-password', href: 'https://example.com' },
      ],

      settingsItems: [
        { value: 'notifications', title: 'Notifications', subtitle: 'Notify me about updates to apps or games that I downloaded' },
        { value: 'sound', title: 'Sound', subtitle: 'Auto-update apps at any time. Data charges may apply' },
        { value: 'widgets', title: 'Auto-add widgets', subtitle: 'Automatically add home screen widgets when downloads complete' },
      ],

      settingsSelection: [],
    }),
  }
</script>

@06b 06b force-pushed the fix/vlist-forced-colors branch from c36fb92 to 3564664 Compare October 2, 2025 13:20
@06b
Copy link
Contributor Author

06b commented Oct 3, 2025

@J-Sek do you mind giving this a review?

Comment on lines +354 to +356
.v-list-item-title,
.v-list-item-subtitle,
.v-list-item-action
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking at the example markup from the description with a small change to use to instead of href and have one of the links / (matching current page). The icon was still yellow instead of cyan. It can be fixed by adding .v-icon to this list.

BTW. Do you remember how I could further adjust the demo to verify those other classes are needed here? Just want to verify those are necessary, as they stand out a bit.

@J-Sek J-Sek assigned 06b Oct 3, 2025
@J-Sek J-Sek added a11y Accessibility issue C: VListItem labels Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y Accessibility issue C: VListItem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants