Closed PascalLeMerrer closed 4 years ago
This is because text
never gets updated and is always an empty string.
The text input should be kept in the model and then using the onChange
handler to update the model will make the placeholder go away.
https://ellie-app.com/48KhsB753r4a1
This is also related to #63
I left a comment on #63 : https://github.com/mdgriffith/elm-ui/issues/63#issuecomment-631469931
Basically this seems like built-in virtualdom behavior as opposed to something elm-ui could adjust. Beyond using the browser placeholder
element, though that has limitations as well.
I'm also not sure this actually a problem. If you're using elm to handle a text input, you are going to be tracking a value in your model, yeah?
I'm going to close this for now and make a note in the docs to help people avoid it in the future.
Here is a simple example
Expected behavior As soon as a char is entered in the input field, the placeholder should disappear.
Versions