From dc056cf67a13423c2263c705f91153c352fac08e Mon Sep 17 00:00:00 2001 From: VSymonenko Date: Fri, 18 Oct 2019 11:28:13 +0300 Subject: [PATCH 1/8] fix(breakpoint): Passing 0 value to scrollBarWidth --- packages/vuetify/src/services/breakpoint/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vuetify/src/services/breakpoint/index.ts b/packages/vuetify/src/services/breakpoint/index.ts index 618db8648da..9375d880fde 100644 --- a/packages/vuetify/src/services/breakpoint/index.ts +++ b/packages/vuetify/src/services/breakpoint/index.ts @@ -65,7 +65,7 @@ export class Breakpoint extends Service implements IBreakpoint { } this.scrollBarWidth = ( options.scrollBarWidth || - this.scrollBarWidth + (options.scrollBarWidth === 0 ? 0 : this.scrollBarWidth) ) this.init() } From 26ebeba7d61b5fa638c9d6b3e95d5a5bddc1ed2b Mon Sep 17 00:00:00 2001 From: VSymonenko Date: Fri, 25 Oct 2019 11:46:53 +0300 Subject: [PATCH 2/8] refactor(breakpoint): Passing 0 to scrollBarWidth --- packages/vuetify/src/services/breakpoint/index.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/vuetify/src/services/breakpoint/index.ts b/packages/vuetify/src/services/breakpoint/index.ts index 9375d880fde..df467310086 100644 --- a/packages/vuetify/src/services/breakpoint/index.ts +++ b/packages/vuetify/src/services/breakpoint/index.ts @@ -63,10 +63,7 @@ export class Breakpoint extends Service implements IBreakpoint { ...this.thresholds, ...options.thresholds, } - this.scrollBarWidth = ( - options.scrollBarWidth || - (options.scrollBarWidth === 0 ? 0 : this.scrollBarWidth) - ) + this.scrollBarWidth = options.scrollBarWidth != null ? options.scrollBarWidth : this.scrollBarWidth this.init() } From c6e90a9b9a337afabb0a14db09d3a5c8b1cc6302 Mon Sep 17 00:00:00 2001 From: VSymonenko Date: Sun, 23 Feb 2020 19:51:45 +0200 Subject: [PATCH 3/8] fix(vrangeslider): add uniq id for inputs elements re #6843 --- .../vuetify/src/components/VRangeSlider/VRangeSlider.ts | 1 + .../VRangeSlider/__tests__/VRangeSlider.spec.ts | 8 ++++++++ .../__tests__/__snapshots__/VRangeSlider.spec.ts.snap | 8 ++++---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/vuetify/src/components/VRangeSlider/VRangeSlider.ts b/packages/vuetify/src/components/VRangeSlider/VRangeSlider.ts index c3f65000acd..1ad56341e02 100644 --- a/packages/vuetify/src/components/VRangeSlider/VRangeSlider.ts +++ b/packages/vuetify/src/components/VRangeSlider/VRangeSlider.ts @@ -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 ? `min-${this._uid}` : `max-${this._uid}` return input }) diff --git a/packages/vuetify/src/components/VRangeSlider/__tests__/VRangeSlider.spec.ts b/packages/vuetify/src/components/VRangeSlider/__tests__/VRangeSlider.spec.ts index cdc4fcbbcb7..45067c03c03 100644 --- a/packages/vuetify/src/components/VRangeSlider/__tests__/VRangeSlider.spec.ts +++ b/packages/vuetify/src/components/VRangeSlider/__tests__/VRangeSlider.spec.ts @@ -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() + expect(min.data.attrs.id).not.toEqual(max.data.attrs.id) + }) }) diff --git a/packages/vuetify/src/components/VRangeSlider/__tests__/__snapshots__/VRangeSlider.spec.ts.snap b/packages/vuetify/src/components/VRangeSlider/__tests__/__snapshots__/VRangeSlider.spec.ts.snap index 96791080e33..800d735953d 100644 --- a/packages/vuetify/src/components/VRangeSlider/__tests__/__snapshots__/VRangeSlider.spec.ts.snap +++ b/packages/vuetify/src/components/VRangeSlider/__tests__/__snapshots__/VRangeSlider.spec.ts.snap @@ -6,12 +6,12 @@ exports[`VRangeSlider.ts should render a vertical slider 1`] = `
@@ -68,13 +68,13 @@ exports[`VRangeSlider.ts should render disabled slider 1`] = `
Date: Mon, 24 Feb 2020 22:46:05 +0200 Subject: [PATCH 4/8] Update packages/vuetify/src/components/VRangeSlider/VRangeSlider.ts Co-Authored-By: Andrew Henry --- packages/vuetify/src/components/VRangeSlider/VRangeSlider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vuetify/src/components/VRangeSlider/VRangeSlider.ts b/packages/vuetify/src/components/VRangeSlider/VRangeSlider.ts index 1ad56341e02..d821f372c0a 100644 --- a/packages/vuetify/src/components/VRangeSlider/VRangeSlider.ts +++ b/packages/vuetify/src/components/VRangeSlider/VRangeSlider.ts @@ -107,7 +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 ? `min-${this._uid}` : `max-${this._uid}` + input.data.attrs.id = !i ? `input-min-${this._uid}` : `input-max-${this._uid}` return input }) From 88fe1351158ae0ac296a2fd9ba4e9ee146ae34f9 Mon Sep 17 00:00:00 2001 From: VSymonenko Date: Mon, 24 Feb 2020 22:54:56 +0200 Subject: [PATCH 5/8] test(vrangeslider): update snapshots --- .../__tests__/__snapshots__/VRangeSlider.spec.ts.snap | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/vuetify/src/components/VRangeSlider/__tests__/__snapshots__/VRangeSlider.spec.ts.snap b/packages/vuetify/src/components/VRangeSlider/__tests__/__snapshots__/VRangeSlider.spec.ts.snap index 800d735953d..74c47704549 100644 --- a/packages/vuetify/src/components/VRangeSlider/__tests__/__snapshots__/VRangeSlider.spec.ts.snap +++ b/packages/vuetify/src/components/VRangeSlider/__tests__/__snapshots__/VRangeSlider.spec.ts.snap @@ -6,12 +6,12 @@ exports[`VRangeSlider.ts should render a vertical slider 1`] = `
@@ -68,13 +68,13 @@ exports[`VRangeSlider.ts should render disabled slider 1`] = `
Date: Tue, 25 Feb 2020 08:27:28 +0200 Subject: [PATCH 6/8] refactor(vrangeslider): cleared code style --- .../src/components/VRangeSlider/__tests__/VRangeSlider.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vuetify/src/components/VRangeSlider/__tests__/VRangeSlider.spec.ts b/packages/vuetify/src/components/VRangeSlider/__tests__/VRangeSlider.spec.ts index 45067c03c03..17d4de10a08 100644 --- a/packages/vuetify/src/components/VRangeSlider/__tests__/VRangeSlider.spec.ts +++ b/packages/vuetify/src/components/VRangeSlider/__tests__/VRangeSlider.spec.ts @@ -224,8 +224,8 @@ describe('VRangeSlider.ts', () => { // https://github.com/vuetifyjs/vuetify/issues/6843 it('should be uniq id', async () => { const wrapper = mountFunction() - const [min, max] = wrapper.vm.genInput() + expect(min.data.attrs.id).not.toEqual(max.data.attrs.id) }) }) From cfeb50b9e936e2d524a79a88c20f4731e0501c05 Mon Sep 17 00:00:00 2001 From: VSymonenko Date: Tue, 25 Feb 2020 08:41:52 +0200 Subject: [PATCH 7/8] refactor(vrangeslider): assignment ids algorithm moved to direct logic --- packages/vuetify/src/components/VRangeSlider/VRangeSlider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vuetify/src/components/VRangeSlider/VRangeSlider.ts b/packages/vuetify/src/components/VRangeSlider/VRangeSlider.ts index d821f372c0a..9cb2dc44eda 100644 --- a/packages/vuetify/src/components/VRangeSlider/VRangeSlider.ts +++ b/packages/vuetify/src/components/VRangeSlider/VRangeSlider.ts @@ -107,7 +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-min-${this._uid}` : `input-max-${this._uid}` + input.data.attrs.id = i ? `input-max-${this._uid}` : `input-min-${this._uid}` return input }) From 69d10df1cb7b56d9ba1449aa1dc53f87297d35b6 Mon Sep 17 00:00:00 2001 From: Jacek Karczmarczyk Date: Tue, 25 Feb 2020 21:05:45 +0700 Subject: [PATCH 8/8] Update packages/vuetify/src/components/VRangeSlider/VRangeSlider.ts Co-Authored-By: John Leider --- packages/vuetify/src/components/VRangeSlider/VRangeSlider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vuetify/src/components/VRangeSlider/VRangeSlider.ts b/packages/vuetify/src/components/VRangeSlider/VRangeSlider.ts index 9cb2dc44eda..1172f4dcd88 100644 --- a/packages/vuetify/src/components/VRangeSlider/VRangeSlider.ts +++ b/packages/vuetify/src/components/VRangeSlider/VRangeSlider.ts @@ -107,7 +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}` + input.data.attrs.id = `input-${i ? 'max' : 'min'}-${this._uid}` return input })