microsoft / microsoft/TypeScript
Support HTMLElement.focus() Option FocusVisible
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
🔍 Search Terms
focusVisible
✅ Viability Checklist
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
⭐ Suggestion
Typescript should now support the FocusVisible property of FocusOptions.
📃 Motivating Example
The FocusVisible FocusOption is now supported on all major browsers except Samsung Internet. It is supported on all desktop browsers. It was stated under the previous issue on the topic that a new issue should be opened when the feature is more widely supported, and it is now more widely supported.
Source: HTMLElement: focus() method
💻 Use Cases
- What do you want to use this for? Ensuring the focused element is visibly focused.
- What shortcomings exist with current approaches? There isn't a workaround for this.
- What workarounds are you using in the meantime? There isn't a workaround for this.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the HTMLElement.focus() and FocusOptions declarations in TypeScript's DOM typings. Check how the existing focus options are represented, then add the FocusVisible property to the appropriate declaration. Done means TypeScript accepts FocusVisible when calling HTMLElement.focus().
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100