Skip to content

Commit

Permalink
fix(VColorPicker): never change track color
Browse files Browse the repository at this point in the history
closes #16689
  • Loading branch information
nekosaur committed Feb 16, 2023
1 parent 2705883 commit 46eaef7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/vuetify/src/components/VColorPicker/VColorPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { makeElevationProps } from '@/composables/elevation'
import { makeRoundedProps } from '@/composables/rounded'
import { makeThemeProps } from '@/composables/theme'
import { useProxiedModel } from '@/composables/proxiedModel'
import { provideDefaults } from '@/composables/defaults'

// Utilities
import { defineComponent, HSVtoCSS, useRender } from '@/util'
Expand Down Expand Up @@ -108,6 +109,14 @@ export const VColorPicker = defineComponent({
if (!props.modes.includes(mode.value)) mode.value = props.modes[0]
})

provideDefaults({
VSlider: {
color: undefined,
trackColor: undefined,
trackFillColor: undefined,
},
})

useRender(() => (
<VSheet
rounded={ props.rounded }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,4 +288,23 @@ describe('VColorPicker', () => {
expect(emits).to.have.length(1)
})
})

it('should not use global defaults for slider color', () => {
cy.mount(() => (
<Application>
<VColorPicker />
</Application>
), null, {
defaults: {
VSlider: {
color: 'primary',
trackColor: 'primary',
trackFillColor: 'primary',
},
},
})

cy.get('.bg-primary').should('not.exist')
cy.get('.text-primary').should('not.exist')
})
})

0 comments on commit 46eaef7

Please sign in to comment.