-
-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Placeholder not been applied #152
Comments
Which theme and schema version? I'll take a look at it after a Christmas. |
|
I test it and it's also not working for me too. |
ohhhhhhh @vladejs it's not a bug. You need set <AutoForm schema={LoginSchema} placeholder={true}
onSubmit={doc => console.log(doc)}>
</AutoForm> It's part of docs that you can see placeholder is disabled by default. // Default placeholder prop for all fields.
// By default it's false - set it to true to enable placeholders for the
// whole form.
placeholder={false} You can read it here: https://github.com/vazco/uniforms/blob/master/API.md#baseform |
@vladejs: is it working for you? |
@cyclops24 , @radekmie It doesn't work and it's a bug, because as the API docs says:
Putting I want to put placeholders to fields I choose to. Moreover, even with this prop set to venue:
type: String
allowedValues: ['Home', 'Community', 'Other']
optional: true
uniforms:
placeholder: 'Select a value' So the expected behaviour should be:
|
How about... Both? I've found a bug - if you've specified both @vladejs: it's not a bug - it's a consequence of another feature. Let's describe how it works right now:
(please remember, that above solution is incorrect) I hope, that you see the problem. We can't allow forcing field placeholder through the schema. Schemas defines placeholders but not shows them. If you want to see it, then you have to use Thoughts? I will deploy this fix tomorrow because my current solution is working, but it grew from 5 lines of logic (described above) to around 30... I'll describe it more in detail tomorrow. |
@cyclops24 There is a bug, that makes the placeholer incorrect (sometimes), but it is showing when it should. |
Fixed. I've also made this logic flat to make it more readable - if you want to know, how it works the source is clear enough. |
Thanks @radekmie I checked and it's worked well with custom text when set |
@radekmie , have you tested the example I posted? It still doesn't work for me, I just updated to uniforms-bootstrap3 v1.8.1: venue:
type: String
allowedValues: ['Home', 'Community', 'Other']
optional: true
uniforms:
placeholder: 'Select a value' On component:
|
Well, looking to my production environment on modulus it works fine, I think I missed something on my local machine. Anyway, sleep well tonight, I think it's fixed :D Thanx again and, Happy New Year!. |
I have a simple schema and placeholder value is not working properly:
Is maybe a regression?
The text was updated successfully, but these errors were encountered: