Closed bbrtj closed 2 years ago
Probably better to have an optional argument to new and or generate to toggle this with the default being off so that behaviour doesn't change if someone updates the module. As is I consider it neutral.
It is more of a bugfix in my view.
Imagine a minimal login form with two inputs (user / password) and no labels. User knows which is which from the placeholders. It isn't uncommon to have a minimal form that is fully described by the placeholders.
Once the form is submitted, if the login data was not valid, the form has to be prefilled to have the same data as was entered before sending. This removes placeholders, and you should only see what you entered previously. However, password field is best not sent back filled out to avoid plaintext password in the HTML document.
This results in the password field empty but without placeholder, which is certainly not desired behavior. I think it's better to provide HTML with the placeholder regardless of data and it will properly handle this and other cases.
I'll merge this, since it should make module behavior less surprising.
Placeholders are used in text input / textarea fields, where they do not clash with actual values and only become visible when the text is deleted. Always generating them should be more consistent than doing so conditionally.
Resolves #9