Skip to content
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

User Story: implement InputField component with its useInputField hook #2

Open
csantiago132 opened this issue Oct 1, 2024 · 0 comments · May be fixed by #11
Open

User Story: implement InputField component with its useInputField hook #2

csantiago132 opened this issue Oct 1, 2024 · 0 comments · May be fixed by #11
Assignees
Labels
enhancement New feature or request

Comments

@csantiago132
Copy link
Contributor

csantiago132 commented Oct 1, 2024

Create the components needed for InputField & implement useInputFieldAdapter for Form Input Handling with Conform and React Aria

Component Interaction Diagram

This diagram demonstrates the interaction between the different React Aria hooks (useTextField) and Conform's useField in the useInputFieldAdapter.

graph LR
    A[useInputFieldAdapter Hook] --> B[useField from conform-to/react]
    B --> C[Generates Field State, Error, Events]
    A --> D[useTextField from react-aria/textfield]
    D --> E[Generates Aria Props for Accessibility]
    A --> F[Returns Combined Props for Input, Label, Error Message]
    F --> G[React Form Component]
Loading

Testing Strategy

https://kurocado-studio.github.io/html-forms/a11y-testing-strategy.html

Acceptance Criteria:

  • The useInputFieldAdapter hook should utilize the useField from @conform-to/react to manage field state, errors, and validation.
  • The hook should incorporate useTextField from @react-aria/textfield to ensure accessibility features like aria properties and error messages.
  • The hook must be generic enough to handle various input field types (e.g., text, email, password) via props.
  • The hook should handle required fields, showing proper validation and error messages when necessary.
  • The mergeProps utility should be used to combine React Aria's inputProps with additional props passed into the input.
  • The useRef should be used for the input element to manage focus and DOM interaction.
  • There is a default/demo AriaInputField component
@csantiago132 csantiago132 self-assigned this Oct 1, 2024
@csantiago132 csantiago132 converted this from a draft issue Oct 1, 2024
@csantiago132 csantiago132 changed the title User Story: Implement InputField User Story: implement and expand InputField component with its useInputField hook Oct 1, 2024
@csantiago132 csantiago132 added the enhancement New feature or request label Oct 1, 2024
@csantiago132 csantiago132 changed the title User Story: implement and expand InputField component with its useInputField hook User Story: implement InputField component with its useInputField hook Oct 1, 2024
@csantiago132 csantiago132 linked a pull request Oct 11, 2024 that will close this issue
@csantiago132 csantiago132 linked a pull request Oct 13, 2024 that will close this issue
@csantiago132 csantiago132 moved this to Todo in HTML Forms Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

1 participant