fix: apply layout styles to div tag, closes #1130 (#1142)

This commit is contained in:
Huang Xin
2025-05-13 19:48:21 +08:00
committed by GitHub
parent 4779e2638f
commit d96fb32bcf
2 changed files with 7 additions and 4 deletions
+5 -2
View File
@@ -75,7 +75,10 @@ const Slider: React.FC<SliderProps> = ({
<div
className='bg-base-300 absolute h-full rounded-full'
style={{
width: percentage > 0 ? `calc(${percentage}% + ${heightPx / 2}px)` : '0px',
width:
percentage > 0
? `max(calc(${percentage}% + ${heightPx / 2}px), ${heightPx}px)`
: '0px',
[isRtl ? 'right' : 'left']: 0,
}}
></div>
@@ -94,7 +97,7 @@ const Slider: React.FC<SliderProps> = ({
}}
>
<div
className={`bg-base-200 flex h-full items-center justify-center rounded-full text-sm shadow-md ${bubbleClassName}`}
className={`bg-base-200 flex h-full items-center justify-center rounded-full text-xs shadow-md ${bubbleClassName}`}
style={{ width: `${heightPx}px` }}
>
{bubbleElement || bubbleLabel}