mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
fix(slider): use and update react slider EE-4522 (#7987)
This commit is contained in:
parent
f94147b07b
commit
9f3d5185b0
10 changed files with 154 additions and 43 deletions
|
@ -8,7 +8,14 @@ export default {
|
|||
title: 'Components/Form/Slider',
|
||||
} as Meta;
|
||||
|
||||
function Template({ value, min, max, step }: JSX.IntrinsicAttributes & Props) {
|
||||
function Template({
|
||||
value,
|
||||
min,
|
||||
max,
|
||||
step,
|
||||
dataCy,
|
||||
visibleTooltip,
|
||||
}: JSX.IntrinsicAttributes & Props) {
|
||||
const [sliderValue, setSliderValue] = useState(min);
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -22,6 +29,8 @@ function Template({ value, min, max, step }: JSX.IntrinsicAttributes & Props) {
|
|||
step={step}
|
||||
value={sliderValue}
|
||||
onChange={setSliderValue}
|
||||
dataCy={dataCy}
|
||||
visibleTooltip={visibleTooltip}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -32,4 +41,6 @@ Primary.args = {
|
|||
max: 100,
|
||||
step: 1,
|
||||
value: 5,
|
||||
visibleTooltip: true,
|
||||
dataCy: 'someView-coolSlider',
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue