Skip to content

Commit

Permalink
Merge pull request #196 from Geoportail-Luxembourg/GITLAB-32-bypass_s…
Browse files Browse the repository at this point in the history
…lider_issue

set better default values
  • Loading branch information
rmichaelis authored Feb 21, 2025
2 parents 6ae795c + ffde8d2 commit 1cef809
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/common/slider-range/slider-range-thumb.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ const emit = defineEmits<{
const isDragging = ref(false)
const elRefTrack = ref<HTMLElement>()
const elRefThumb = ref<HTMLElement>()
const elRefTrackWidth = computed(() => elRefTrack.value?.offsetWidth || 0)
const elRefThumbWidth = computed(() => elRefThumb.value?.offsetWidth || 40)
/*
TODO: Since we now use v-show instead of v-if in layer-panel.vue, the element is present in the DOM but remains hidden.
As a result, offsetWidth always returns its default value instead of the actual one.
We need to find a way to retrieve the correct offsetWidth value.
*/
const elRefTrackWidth = computed(() => elRefTrack.value?.offsetWidth || 274)
const elRefThumbWidth = computed(() => elRefThumb.value?.offsetWidth || 9)
const currentValue = ref(props.selectedValue) // Is detached from selectedValue, keep its own state
const currentLeftOffset = computed(() => {
const offset = (elRefTrackWidth.value * currentValue.value) / 100
Expand Down

0 comments on commit 1cef809

Please sign in to comment.