Open stsrki opened 1 month ago
TextInput would be better. Personally I would do this for everything with Edit in the name.(Date Edit, Color Edit etc)
Input seems too generic to me personally, almost feels like anything can go in there, while it's just supposed to be text/strings. I agree with @MrX101 I'd still keep the familiar prefixes, whatever suffix we come up with.
Also Edit suffix has been out for so long and people have become acquainted, I'd probably not bother renaming. Although I do like Input suffix a bit better since it's more similar to the html naming.
Input
alone is abstract. It suggests the suitable specific type of editor will be used.
string
isn't the default data type, it's just an equal member of a set of data types. It's illogical to treat it differently.
I like the Input name because it matches the HTML element name. Agree with @MrX101 that it should be part of the name and applied to other Edit components. I prefer the name formatting: Input[type]... for example InputText, InputColor, InputDate, InputNumber, ...
Everything is still in the proposal phase, so nothing is set in stone.
The general idea with the new naming scheme is to match the native HTML naming as close as possible. That way the naming, I believe, will better communicate what and how the component would be used. And what are its limitations when dealing with in native HTML and browser mode.
When we work with native <input />
and when we don't specify type,
the input element will render as a textual element, so, we can only enter strings in this input. Once we define a type
, it will render other input elements like date, time, file, etc.
That same idea should apply to the new component naming scheme.
HTML | Blazorise |
---|---|
<input /> |
<Input /> |
<input type="date" /> |
<DateInput /> |
<input type="time" /> |
<TimeInput /> |
<input type="file" /> |
<FileInput /> |
We can still consider TextInput
as it still makes perfect sense.
HTML | Blazorise |
---|---|
<input /> |
<TextInput /> |
That being said. We're still months till we start with the actual work. So until then, we're going to discuss it in detail and listen for any feedback.
For simple string value types, I find the
Input
component name good alternative. Based on my research no other component library seems to have the same name. Even the built-in components don't conflict with the naming so there should not be any problems. I still need to see if maybe Input is a reserved keyword in razor. For exampleLink
name has some limitations when used.Old:
New:
This can be done after the https://github.com/Megabit/Blazorise/pull/5732 is merged.