KivyMD icon indicating copy to clipboard operation
KivyMD copied to clipboard

Fix a step in the MDSlider widget

Open HeaTTheatR opened this issue 1 year ago • 0 comments

At the moment, a step with the float type is not supported in the MDSlider widget:

from kivymd.app import MDApp
from kivymd.uix.slider import MDSlider, MDSliderHandle, MDSliderValueLabel


class Test(MDApp):
    def build(self):
        return MDSlider(
            MDSliderHandle(), MDSliderValueLabel(), step=0.1
        )


Test().run()

Oupout:

   File "kivymd/uix/slider/slider.py", line 283, in update_points
     for i in range(0, slider_max_value + 1, step):

 TypeError: 'float' object cannot be interpreted as an integer

HeaTTheatR avatar Jan 31 '24 07:01 HeaTTheatR