[BUG] Textfield and TextArea fields placeholder is not customizable
See original GitHub issueEnvironment
Please provide as many details as you can:
- Hosting type
- [] Local deployment
- Version:
- [] Local deployment
- Formio.js version: 4.13.10
- Frontend framework: None
- Browser: Chrome
- Browser version: 104.0.5112.101
Steps to Reproduce
- Edit textfield component editForm
- Modify label placeholder to “Hello” for example
Expected behavior
in Form builder when you drag textfiled component, you should see “Hello” as a placeholder of label input
Observed behavior
textfield and textarea components display respectively “Text Field” and “Text Area” as default values not even as placeholders
Example
same issue for checkbox component too (and probably the rest of components)
Here is the code snippet for customizing the textfiled component editForm:
Formio.Components.components.textarea.editForm = function () {
return {
components: [
{
type: 'tabs', key: 'tabs',
components: [
{
key: 'display', label: 'Weergave', weight: 0,
components: [
{type: 'textfield', key: "label", label: 'Label', placeholder: 'Label'},
{type: 'input', key: 'placeholder', label: 'Placeholder'},
descriptionComponent,
],
},
{
key: 'validation', label: 'Validatie', weight: 10,
components: [
{type: 'checkbox', key: 'validate.required', label: 'Vereist'},
]
}
],
},
],
};
};
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:29 (1 by maintainers)
Top Results From Across the Web
HTML5 textarea placeholder not appearing - Stack Overflow
If you have an input in your form and placeholder is not showing because a white space at the beginning, this may be...
Read more >bug(md-input) placeholder hidden underneath input with no ...
The placeholder is hidden behind the input element. Selecting the element triggers the ordinary animation, moving the placeholder above the ...
Read more >Ability to add placeholder text in the bug_report_page.php
Asking if it's possible to make customized placeholder text that: ... once the user starts entering their information in said text field
Read more >Don't Use The Placeholder Attribute - Smashing Magazine
When a person enters information into an input, its placeholder content will disappear. The only way to restore it is to remove the...
Read more >Placeholders in Form Fields Are Harmful
If the placeholder remains in the field as editable text, users are forced to manually select and delete it.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Join me on discord @akhossan#3635
@PrathyushaModala No you are getting it wrong, I guess you have to take a look first at components customization in the documentation, Think of it is if we want to create a new custome component that is not offered by formio, in this case we need to define the schema, template (how the component UI looks like) and the editForm which is our matter here editForm is controlling the popup dialog UI when you drag the component to the editing area. the layout of that dialog is customized by defining a new function that returns an array of objects, each object is a field that is going to be edited inside the dialog. for example say we created a new custome component, and we call it mycustomfield , so the editForm of this new field is going to be customized the following way:
Formio.Components.component.mycustomefield = function () { return { components: [ {type: "textfield", key: "label", label: "Label", placeholder: "my placeholder goes here"}, .... ] } }
Now the problem appears in this level, the wording “my placeholder goes here” is not going to appear in the editForm, “Field input” or “Text Area” is what is going to be there instead.