Skip to content

Add support for firstInputRef#625

Open
frederickf wants to merge 1 commit into
wojtekmaj:mainfrom
frederickf:firstInputRef
Open

Add support for firstInputRef#625
frederickf wants to merge 1 commit into
wojtekmaj:mainfrom
frederickf:firstInputRef

Conversation

@frederickf

Copy link
Copy Markdown

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
Copy Markdown

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

@ahmadshiddiq

Copy link
Copy Markdown

is there any plan to merge this PR?

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.

3 participants