Skip to content

Commit

Permalink
fix(QSlider): wrong ticks when inner-min is equal to inner-max quasar…
Browse files Browse the repository at this point in the history
  • Loading branch information
pdanpdan committed Sep 12, 2023
1 parent 5347caa commit d5572c8
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions ui/src/components/slider/slider-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,12 @@ export const SliderMixin = {
},

innerBarStyle () {
const innerDiff = this.innerMaxRatio - this.innerMinRatio
const acc = {
[ this.positionProp ]: `${100 * this.innerMinRatio}%`,
[ this.sizeProp ]: `${100 * (this.innerMaxRatio - this.innerMinRatio)}%`
[this.sizeProp]: innerDiff === 0
? '2px'
: `${100 * innerDiff}%`
}
if (this.innerTrackImg !== void 0) {
acc.backgroundImage = `url(${this.innerTrackImg}) !important`
Expand Down Expand Up @@ -306,18 +309,16 @@ export const SliderMixin = {
},

markerStyle () {
if (this.innerBarLen !== 0) {
const size = 100 * this.markerStep / this.innerBarLen

return {
...this.innerBarStyle,
backgroundSize: this.vertical === true
? `2px ${size}%`
: `${size}% 2px`
}
}
const size = this.innerBarLen === 0
? 100
: 100 * this.markerStep / this.innerBarLen

return null
return {
...this.innerBarStyle,
backgroundSize: this.vertical === true
? `2px ${size}%`
: `${size}% 2px`
}
},

markerLabelsMap () {
Expand Down

0 comments on commit d5572c8

Please sign in to comment.