show brush while change slide

This commit is contained in:
Sanster
2022-04-27 17:19:44 +08:00
parent 49c42741a5
commit 3580d4281f
2 changed files with 34 additions and 7 deletions

View File

@@ -6,10 +6,11 @@ type SliderProps = {
min?: number
max?: number
onChange: (value: number) => void
onClick: () => void
}
export default function Slider(props: SliderProps) {
const { value, onChange, label, min, max } = props
const { value, onChange, onClick, label, min, max } = props
const step = ((max || 100) - (min || 0)) / 100
@@ -27,6 +28,7 @@ export default function Slider(props: SliderProps) {
ev.stopPropagation()
onChange(parseInt(ev.currentTarget.value, 10))
}}
onClick={onClick}
/>
</div>
)