Megabit / Blazorise

Blazorise is a component library built on top of Blazor with support for CSS frameworks like Bootstrap, Tailwind, Bulma, AntDesign, and Material.
https://blazorise.com/
Other
3.31k stars 533 forks source link

Date component - Placeholder attribute doesn't kick in #1545

Closed jensengbg-jakob-reesalu closed 3 years ago

jensengbg-jakob-reesalu commented 3 years ago

Describe the bug The placeholder attribute does not change the date component's default placeholder "yyyy-mm-dd".

To Reproduce

  1. Add this code: <DateEdit TValue="DateTime?" Placeholder="From"/> <DateEdit TValue="DateTime?" Placeholder="To"/>

  2. Run the application.

  3. See that the date field still shows "yyyy-mm-dd" instead of "From" or "To".

Expected behavior I expected the fields to show "From" and "To", not "yyyy-mm-dd".

stsrki commented 3 years ago

DateEdit is using <input type="date" />, and unfortunately placeholder attribute is not supported for date inputs. The only way around this is to use <input type="text" /> but that would lead to a lot more trouble with edit mask, date formats, etc.

jensengbg-jakob-reesalu commented 3 years ago

Oh, I see! Maybe you want to change the documentation for Date component then, because it says at the bottom that placeholder is an attribute for it.

stsrki commented 3 years ago

I have removed Placeholder from Date documentation.

Thank you!

TheTonyHansen commented 2 years ago

"Placeholder" still appears as an attribute in the DateEdit documentation. If this isn't supported, please remove it ... I wasted hours trying to get this to work.

https://blazorise.com/docs/components/date/