microsoft / microsoft/TypeScript

Support HTMLElement.focus() Option FocusVisible

オープン 初心者向け
#63,626 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Fixed
主要言語
Go
スター
111k
フォーク
14.3k
平均マージ
2日 4時間
マージ済み PR(30日)
132

説明

### 🔍 Search Terms

focusVisible

### ✅ Viability Checklist

- [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
- [x] This wouldn't change the runtime behavior of existing JavaScript code
- [x] This could be implemented without emitting different JS based on the types of the expressions
- [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- [x] This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- [x] 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](https://github.com/microsoft/TypeScript/issues/61458) that a new issue should be opened when the feature is more widely supported, and it is now more widely supported.
Image
Source: [HTMLElement: focus() method](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#browser_compatibility)

### 💻 Use Cases

1. What do you want to use this for? Ensuring the focused element is visibly focused.
2. What shortcomings exist with current approaches? There isn't a workaround for this.
3. What workarounds are you using in the meantime? There isn't a workaround for this.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、TypeScript の DOM 型定義にある HTMLElement.focus() と FocusOptions の宣言を見つけます。既存の focus オプションがどのように表現されているかを確認し、適切な宣言に FocusVisible プロパティを追加します。HTMLElement.focus() の呼び出し時に TypeScript が FocusVisible を受け入れれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
frontend
issue の種類
機能追加
難易度
2/5
見積もり時間
1〜3時間
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
72/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。