Merge pull request #3769 from primefaces/issue-3768
Slider: Accessibility and focus updates on dragpull/3774/merge
commit
f14b464048
|
@ -18,7 +18,7 @@ describe('Slider.vue', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should drag start and end', async () => {
|
it('should drag start and end', async () => {
|
||||||
await wrapper.vm.onDragStart({ preventDefault: () => {} });
|
await wrapper.vm.onDragStart({ preventDefault: () => {}, currentTarget: { focus: () => {} } });
|
||||||
|
|
||||||
expect(wrapper.find('.p-slider').classes()).toContain('p-slider-sliding');
|
expect(wrapper.find('.p-slider').classes()).toContain('p-slider-sliding');
|
||||||
|
|
||||||
|
|
|
@ -155,24 +155,12 @@ export default {
|
||||||
if (newValue < this.min) newValue = this.min;
|
if (newValue < this.min) newValue = this.min;
|
||||||
else if (newValue >= this.max) newValue = this.max;
|
else if (newValue >= this.max) newValue = this.max;
|
||||||
|
|
||||||
if (newValue > modelValue[1]) {
|
modelValue[0] = newValue;
|
||||||
modelValue[1] = newValue;
|
|
||||||
|
|
||||||
this.handleIndex = 1;
|
|
||||||
} else {
|
|
||||||
modelValue[0] = newValue;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (newValue > this.max) newValue = this.max;
|
if (newValue > this.max) newValue = this.max;
|
||||||
else if (newValue <= this.min) newValue = this.min;
|
else if (newValue <= this.min) newValue = this.min;
|
||||||
|
|
||||||
if (newValue < modelValue[0]) {
|
modelValue[1] = newValue;
|
||||||
modelValue[0] = newValue;
|
|
||||||
|
|
||||||
this.handleIndex = 0;
|
|
||||||
} else {
|
|
||||||
modelValue[1] = newValue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (newValue < this.min) newValue = this.min;
|
if (newValue < this.min) newValue = this.min;
|
||||||
|
@ -199,6 +187,7 @@ export default {
|
||||||
this.handleIndex = index;
|
this.handleIndex = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
event.currentTarget.focus();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
},
|
},
|
||||||
onDrag(event) {
|
onDrag(event) {
|
||||||
|
|
Loading…
Reference in New Issue