This is a migrated thread and some comments may be shown as answers.

MinLength, MaxLength, Pattern

1 Answer 2129 Views
TextBox
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 20 Sep 2019, 07:15 PM
Is it just me or were these properties removed from the TextBox?  I had code with those properties set that no longer compiles after upgrading.

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 22 Sep 2019, 05:34 AM

Hi Paul,

Yes, these parameters have been removed. You can find the full list of breaking changes in 2.0.0 in the following page: https://docs.telerik.com/blazor-ui/upgrade/breaking-changes/2-0-0.

Those parameters used to render as HTML attributes which is not very effective. For one, minlength is still not supported well by the browsers, so it wouldn't really work. Then, such things are better left to validation so a meaningful message can be shown to the user as to why their input is not being accepted. Thirdly, it is likely that they will be brought back through attribute splatting. Also, you can respond to events of the textbox and if input does not fit your needs, you can avoid updating it in the model, in case validation is not an option.

 

Regards,
Marin Bratanov
Progress Telerik

 UI for Blazor
Chris
Top achievements
Rank 1
commented on 28 Jul 2021, 05:04 PM

Based on other posts here, attribute splatting was not introduced. How you do recommend implementing maxlength?
Marin Bratanov
Telerik team
commented on 28 Jul 2021, 07:48 PM

Indeed, Chris, attribute splatting is not implemented because it is far too ambiguous for most components.

To implement max length, I recommend one (or both) of the following options:

Tags
TextBox
Asked by
Paul
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or