I’m using this slider (https://github.com/vueform/slider#multiple-slider) in one of my form field and for some reasons, both the tooltips are stuck at one place.
Template Code of the slider component:
<template>
<div class="input-container">
<label class="input-label">{{ label }}</label>
<div class="input-field">
<Slider
v-model="value"
:min="0"
:max="4500"
:showTooltip="always"
:format="formatTooltip"
class="slider-red"
/>
</div>
</div>
</template>
Script:
<script>
import Slider from '@vueform/slider'
import '@vueform/slider/themes/default.css';
export default {
name: 'RangeSlider',
components: {
Slider,
},
props: {
label: String,
},
data() {
return {
value: [0, 4500],
}
},
watch: {
activeButton(newValue) {
this.activeButtonValue = newValue
},
},
methods: {
formatTooltip(val) {
return `$${val}`
},
},
}
</script>
<style scoped>
.input-label {
position: absolute;
top: -10px;
left: 10px;
color: #d7c8f1;
padding: 0 5px;
text-decoration-color: white;
}
.input-field {
padding-top: 20px;
padding-bottom: 20px;
border: 1px solid var(--secondary-color);
color: white;
cursor: pointer;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.space-right {
margin-right: 16px;
}
.active {
border: 1px solid var(--secondary-color);
padding: 4px !important;
border-radius: 12px !important;
color: #101828 !important;
background-color: #f9fafb;
}
.button {
border: none;
color: var(--primary-color);
font-weight: 500;
font: inherit;
cursor: pointer;
padding: 0px;
border-radius: 8px;
}
.content-button {
padding-left: 12px;
padding-right: 12px;
padding-top: 6px;
padding-bottom: 6px;
border-radius: 8px;
border: 1px solid var(--secondary-color);
}
.slider-red {
--slider-connect-bg: #EF4444;
--slider-tooltip-bg: #EF4444;
--slider-handle-ring-color: #EF444430;
}
</style>
I have tried formatting the width/height of the class, but it doesn’t seem to work.
The problem state: