FormField render render a border for children input inside custom component
See original GitHub issueWhen I use a custom component, with an input field, as child of a FormField
I have the bottom border from FormField
and the full border from the input field.
Here an example using a composed field for password input and a plain TextInput
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
ASP.NET Core Blazor forms and input components
For input components in a form with an EditContext, the default validation behavior includes updating the field CSS class to reflect the field's ......
Read more >Change style of existing input fields whenever error occurs in ...
As of now there doesn't seem to be an easy way to do this. You can render a custom children for <Field> to...
Read more >How to create reusable form components with React Hook ...
The first step is to create an input component. Creating an isolated component can be a good way to provide consumers of your...
Read more ><Field /> | Formik
In Formik 0.9 to 1.x, the render prop could also be used for rendering. ... input; select; textarea; A valid HTML element name;...
Read more >Create and style a text field - Flutter documentation
Text fields allow users to type text into an app. They are used to build forms, send messages, create search experiences, and more....
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
Thanks for reporting guys, just to make sure you know you can remove the border from the theme https://v2.grommet.io/formfield#formField.border.side, but I’m aware it will affect all of your FormFields and not just the custom component one.
This issue makes me think we need to consider a
border
prop on the FormField component and not just on the theme.The FormField component is testing the displayName property of the child component to decide the style of the border / padding:
As a workaround it is possible to rename the displayName property of the custom component to one in the list that it is tested. Something like the code below:
It would be nice if we could provide a custom property to let Grommet know that the custom component should be treated as an input.
CustomComponent.isGrommetInput = true
for example.