Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(VRangeSlider): add unique id for inputs elements #10654

Merged
merged 14 commits into from
Feb 25, 2020
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export default VSlider.extend({
input.data = input.data || {}
input.data.attrs = input.data.attrs || {}
input.data.attrs.value = this.internalValue[i]
input.data.attrs.id = i ? `input-max-${this._uid}` : `input-min-${this._uid}`
jacekkarczmarczyk marked this conversation as resolved.
Show resolved Hide resolved

return input
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,12 @@ describe('VRangeSlider.ts', () => {
expect(wrapper.vm.internalValue).toEqual([0, 0])
})
})

// https://github.com/vuetifyjs/vuetify/issues/6843
it('should be uniq id', async () => {
const wrapper = mountFunction()
const [min, max] = wrapper.vm.genInput()
VSymonenko marked this conversation as resolved.
Show resolved Hide resolved

expect(min.data.attrs.id).not.toEqual(max.data.attrs.id)
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ exports[`VRangeSlider.ts should render a vertical slider 1`] = `
<div class="v-input__slot">
<div class="v-slider v-slider--vertical theme--light">
<input value="0"
id="input-29"
id="input-min-29"
readonly="readonly"
tabindex="-1"
>
<input value="0"
id="input-29"
id="input-max-29"
readonly="readonly"
tabindex="-1"
>
Expand Down Expand Up @@ -68,13 +68,13 @@ exports[`VRangeSlider.ts should render disabled slider 1`] = `
<div class="v-input__slot">
<div class="v-slider v-slider--horizontal v-slider--disabled theme--light">
<input value="0"
id="input-33"
id="input-min-33"
disabled="disabled"
readonly="readonly"
tabindex="-1"
>
<input value="0"
id="input-33"
id="input-max-33"
disabled="disabled"
readonly="readonly"
tabindex="-1"
Expand Down