You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the Input component in Gluestack UI does not support the name attribute, which is essential for handling form submissions and integration with form libraries like react-hook-form. Adding support for the name attribute would make it easier to manage forms and improve the flexibility of the component in various use cases.
Problem Statement
The lack of a name attribute in the Input component presents a limitation when using it with form libraries such as react-hook-form. The name attribute is necessary for proper form field management, especially when dealing with controlled components in complex forms. Without this attribute, it's challenging to integrate the Input component into form handling processes, potentially leading to a more cumbersome development experience.
Proposed Solution or API
Add support for the name attribute to the Input component in Gluestack UI. The component should accept a name prop and pass it down to the underlying input element, making it compatible with form libraries. Here is a code snippet illustrating the proposed change:
<Input
name={name} // Add this line to support the name attribute
inputAccessoryViewID="close"
onBlur={(event: any) => {
field.onBlur();
props.onBlur?.(event);
}}
onChangeText={(text: any) => {
const normalizedText = normalize ? normalize(text) : text;
field.onChange(normalizedText);
props.onChangeText?.(normalizedText);
}}
ref={(input) => {
if (inputRef) {
setRef(inputRef, input);
}
setRef(field.ref, input);
}}
testID={`InputField[${name}]--Input`}
value={format?.(field.value) ?? field.value}
{...props}
/>
In this example, the name prop is added to the Input component, which allows it to be utilized in form submissions and other form-handling mechanisms.
Alternatives
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Description
Currently, the
Input
component in Gluestack UI does not support thename
attribute, which is essential for handling form submissions and integration with form libraries like react-hook-form. Adding support for thename
attribute would make it easier to manage forms and improve the flexibility of the component in various use cases.Problem Statement
The lack of a
name
attribute in the Input component presents a limitation when using it with form libraries such as react-hook-form. Thename
attribute is necessary for proper form field management, especially when dealing with controlled components in complex forms. Without this attribute, it's challenging to integrate the Input component into form handling processes, potentially leading to a more cumbersome development experience.Proposed Solution or API
Add support for the name attribute to the Input component in Gluestack UI. The component should accept a name prop and pass it down to the underlying input element, making it compatible with form libraries. Here is a code snippet illustrating the proposed change:
In this example, the name prop is added to the Input component, which allows it to be utilized in form submissions and other form-handling mechanisms.
Alternatives
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: