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

Add support for firstInputRef #625

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

frederickf
Copy link

This PR is a result of the discussion at #622

In Input.tsx and MonthSelect.tsx I had to update inputRef to be typed with MutableRefObject because later I assign the referenced element in a ref callback.

I hope it is okay that I updated Test.tsx to demonstrate how it works. There wasn't much room in the README for an example.

In Test.tsx I originally used a label element, but that triggered some accessibility warnings related not using the for attribute. I tried using div and got accessibility warnings about using an onClick on a non-interactive element. I ultimately used a button, styled to look like a label. Normally a label would communicate the purpose of the input, but I think a button will be fine because the underlying inputs all support the appropriate aria labels identifying their purpose.

@frederickf frederickf mentioned this pull request Jun 26, 2023
2 tasks
@lochstar
Copy link

I also need this, for the exact same reason. Adding a label and wish to focus the input when clicking the label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants