Remove default label values on keypress
Given that I am editing a (short text | long text | checkbox | choicelist ) label in the form builder
When I click on the label and the field receives focus
Then the user can type right away without having to replace the default value (Question| option) (1|2|3)
Good catch!
I tried this one without any success. I didn't find a way to assign onFocus event to the textWidget. I've also tried to use jsonschema's placeholder but it's not available on the installed version.
Please go ahead if you want to upgrade the installed version of RJSF!
i may try. however the last version of jsonschema required the last version of react.
I just ran into this and found this issue already reported.
@almet I think it's better to keep the default value (Question| option) (1|2|3) as a placeholder instead of value for the form field. What do you think?
I'll push the fix once you confirm.
That sounds like the best way to act, I concur. Let's go!
Cool! I'll push the fix later today.
@almet I tried adding something like following after this line here
state.uiSchema[_slug]["ui:placeholder"] = name;
Doesn't seem to work. Can you please check this?
Hum, I tried as well without more success. Actually, I wonder if what we want here is a placeholder, since the default value should stay the default one, whereas a placeholder would force the user to enter a value.
Hmm.. I have another idea -
We can add onclick="this.focus();this.select()" to the input field. This will make sure once user clicks in the input field, all the default text is selected automatically hence making it easy for the user to remove it and add something custom. Makes sense?
Yes, let's try this