MudBlazor/MudBlazor

Add AlignContent parameter to MudTextField

Ouverte

#1 114 ouverte le 7 mars 2021

 (2 commentaires) (0 réaction) (0 personne assignée)C# (1 631 forks)batch import
enhancementgood first issue

Métriques du dépôt

Stars
 (10 394 étoiles)
Métriques de merge PR
 (Merge moyen 6j 6h) (108 PRs mergées en 30 j)

Description

MudTextField works well with text (I suppose the clue is in the name) but has some limitations when it comes to numbers.

When entering a number the usual convention in my locale is for the number to be aligned left. This can be achieved through the use of fairly simple CSS but, given the general 'You don't need to know CSS to use MudBlazor' ethos of the project, could be worth including a parameter?

Suggestion - Add an 'AlignContent' parameter to MudTextField

Also, when using a MudTextField for numbers, I typically end up having to create a quite wide element to accommodate the label when the field is empty but then this looks awkward when the number is entered i.e. I can have a 150px wide element to contain a single digit. The examples below are not excessive but when you have a label along the lines of "Current INR" and the value is single digit, it's not great.

MudTextField

The Label in the field when empty then flowing up to the top of the box is a very nice effect, it just doesn't really suit for this scenario. Someone noted on Discord that you can force the label up by using Adornment.Start but as per the examples above I'm already using Adornment.End.

Suggestion - Add a 'LabelBehaviour' parameter to MudTextField (not sure about the parameter name but can't think of a good one.

Guide contributeur