material-components / material-components/material-web

[mwc-textfield] - missing autofocus attribute support

Open
#1,916 3 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type: Feature
Dominant language
SCSS
Stars
11.3k
Forks
1.1k
Avg merge
20h 28m
Merged PRs (30d)
13

Description

Is your feature request related to a problem? Please describe.
autofocus property isn't provided in textfield. making it impossible for consumers to natively focus on textfield's input on load of page

Describe the solution you'd like
Forward autofocus property to actual shadowed input

Describe alternatives you've considered
look up the shadowed input programmatically and call its focus method

Additional context
autofocus attribute is quite a common attribute and should be prioritise for a11y reasons

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the mwc-textfield component and its shadowed input implementation. Check how existing input attributes are forwarded, then verify that the autofocus attribute reaches the actual input and focuses it on page load; no specific file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Domain
accessibility, frontend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.