Completed
Last Updated: 24 Feb 2020 07:35 by ADMIN
Release 2.8.0
Jasmin
Created on: 28 Nov 2019 10:58
Category: DatePicker
Type: Bug Report
1
Min and Max don't limit the text input, only the calendar

Setting Min and Max should also prevent the user from writing a date that is out of their range. At the moment, it only disables the dates in the calendar.

In the meantime, you can use validation to limit the user input.

2 comments
ADMIN
Marin Bratanov
Posted on: 26 Dec 2019 16:10

Hello Tom,

We are working on keyboard support right now and getting to this is a matter of time (we have to work on the underlying DateInput first). When keyboard navigation gets implemented for the date input fully, there will be a possible workaround for this. I will post here once it becomes available.

Even though I cannot commit to certain timeframes, I can suggest you click the Follow button to get notifications about the status of this item. I have also added your Vote for this item, which raises its priority. You can do that yourself for other items that are important to your project - both bugs fixes and new features.

Here is a compromise that I can offer for the time being - a separate date input that is, at the moment disabled to disallow erroneous input, limits the user to using the picker popup. When min and max can work with the keyboard for the date input, you would be able to enable the input, if this particular issue for the date picker has not been fixed yet:

 

@* of course, you should also add validation *@

<style>
    .PickerButtonOnly .k-dateinput-wrap {
        display: none;
    }

    .PickerButtonOnly {
        height: 2em;
        width: 2em;
    }
</style>

<TelerikDateInput Enabled="false" @bind-Value="@date" Min="@min" Max="@max" />
<TelerikDatePicker @bind-Value="@date" Min="@min" Max="@max" Class="PickerButtonOnly"></TelerikDatePicker>

@code{
    DateTime date { get; set; } = DateTime.Now;
    DateTime min { get; set; } = DateTime.Now.AddDays(-5);
    DateTime max { get; set; } = DateTime.Now.AddDays(5);
}

 

 

Regards,
Marin Bratanov
Progress Telerik

 UI for Blazor
Tom
Posted on: 26 Dec 2019 11:26
The alternatives offered here are not sufficient for our project, any estimate on when this bug will be fixed?