Skip to content

Commit dfe779f

Browse files
committed
fix range on safari
1 parent a1f3047 commit dfe779f

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

resources/css/components/range.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
}
6969

7070
.el-range-tooltip-container {
71-
@apply absolute bottom-full pb-2 -translate-x-1/2 left-0 min-w-3;
71+
@apply absolute bottom-full pb-2.5 -translate-x-1/2 left-0 min-w-3;
7272
will-change: left;
7373
}
7474

@@ -79,7 +79,7 @@
7979
.el-range-ticks {
8080
@apply flex flex-row justify-between w-full min-h-1;
8181

82-
option {
82+
& > * {
8383
@apply bg-gray-300 w-px flex-none min-h-0;
8484
}
8585
}

resources/views/components/range/container.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
<div {{ $attributes->class(['el-range-container']) }} x-data="{
44
value: 0,
55
get min() {
6-
return this.input.min || 0;
6+
return parseInt(this.input.min || 0);
77
},
88
get max() {
9-
return this.input.max || 1;
9+
return parseInt(this.input.max || 1);
1010
},
1111
get step() {
12-
return this.input.step || 1;
12+
return parseInt(this.input.step || 1);
1313
},
1414
get input() {
1515
return this.$refs.input;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<datalist {{ $attributes->class('el-range-ticks') }}>
1+
<div {{ $attributes->class('el-range-ticks') }}>
22

33
@if ($slot->isEmpty())
44
<template x-for="i in ticks" x-bind:key="i">
5-
<option x-bind:value="i"></option>
5+
<div x-bind:value="i"></div>
66
</template>
77
@else
88
{{ $slot }}
99
@endif
10-
</datalist>
10+
</div>

workbench/resources/views/demo.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,9 @@ class="relative rounded-full" />
520520
<div class="flex grow items-center justify-center gap-2 border-b border-gray-200">
521521
<x-kit::range.container class="w-52 rounded-full">
522522
<x-kit::range color="black" min="-50" max="50" step="10" value="0"
523-
class="mb-1 w-full" list="range-values" x-model="value" x-ref="input" />
523+
class="mb-1 w-full" x-model="value" x-ref="input" />
524524

525-
<x-kit::range.ticks class="px-2.5" id="range-values" />
525+
<x-kit::range.ticks class="px-2.5" />
526526

527527
<x-kit::range.tooltip.container>
528528
<x-kit::range.tooltip class="rounded" />

0 commit comments

Comments
 (0)