Completed
Last Updated: 11 Nov 2023 08:41 by ADMIN
Release 5.0.0 (15 Nov 2023) (R1 PI1)

Why are the slider buttons of type 'submit' and how do I change them not to be?

 

===ADMIN EDIT===

Temporary solution:

@inject IJSRuntime js

<TelerikSlider @bind-Value="@SliderValue"
               Min="0"
               Max="100"
               SmallStep="1"
               LargeStep="20"
               Width="400px">
</TelerikSlider>

<script suppress-error="BL9992">
    window.changeButtonTypes = function () {
        var buttons = document.querySelectorAll(".k-slider button");
        for (var i = 0; i < buttons.length; i++) {
            buttons[i].type = "button";
        }
    };
</script>

@code {
    public int SliderValue { get; set; }

    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
        if (firstRender)
        {
            await js.InvokeVoidAsync("changeButtonTypes");
        }
    }
}

Completed
Last Updated: 04 Feb 2021 01:11 by ADMIN
Release 2.22.0

The Slider Component only seems to work properly if the range is a multiple of 10.

<TelerikSlider @bind-Value="@MyInteger"
                        Min="0"
                        Max="10"
                        SmallStep="1"
                        LargeStep="1">
        </TelerikSlider>

works as expected.  Same is true if Max is set to 20.  But if Max is set to 7 or 9 or 11 it does not work.  In those cases, clicking on the right arrow button does not do anything and after dragging the slider it magically moves back to 0.  Clicking on a value only works every second time.

Regards,

René