Skip to content

Commit

Permalink
fix: fix responsiveness
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e committed Dec 12, 2024
1 parent 56ac368 commit b64d100
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions apps/ui/src/components/Ui/ResizableHorizontal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const { x, y } = useDraggable(sliderEl, {
const containerWidth = computed(() => {
const offset = sliderOriginalPositionX.value - x.value;
const newWidth = width.value + offset;
const newWidth = Math.round(width.value + offset);
if (props.max && newWidth > props.max) return props.max;
if (props.min && newWidth < props.min) return props.min;
Expand Down Expand Up @@ -57,15 +57,19 @@ onMounted(() => {
</script>

<template>
<div ref="containerEl" :style="{ width: `${containerWidth}px` }">
<div
ref="containerEl"
class="max-md:!w-full"
:style="{ width: `${containerWidth}px` }"
>
<div ref="sliderEl" :class="['slider', { dragging: dragging }]" />
<slot />
</div>
</template>

<style scoped>
.slider {
@apply block fixed z-[99] w-[5px] h-full ml-[-2px];
@apply hidden md:block fixed z-[99] w-[5px] h-full ml-[-2px];
&:before {
@apply h-full border-l block ml-[2px];
Expand Down

0 comments on commit b64d100

Please sign in to comment.