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

feat: add Platform#setTabindex() #293

Merged
merged 4 commits into from
Oct 17, 2023
Merged

feat: add Platform#setTabindex() #293

merged 4 commits into from
Oct 17, 2023

Conversation

yu-ogi
Copy link
Contributor

@yu-ogi yu-ogi commented Oct 16, 2023

このPullRequestが解決する内容

  • InputHandlerviewtabindex: 0 を付与します。
  • tabindex を操作するメソッド Platform#setTabindex() を追加します。

@@ -67,11 +67,17 @@ export class InputHandlerLayer {
view.style.height = size.height + "px";
}

setViewTabindex(tabindex: number | undefined): void {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

議論:

  • 利用者にとって、これを指定する引数は、後方互換性を考えると undefined をデフォルト値にせざるを得ない
  • tabindex の「デフォルト値」は "0" であるべきに思えるが、ここで undefined は「tabindexなし」の表現になっているので、辻褄が合わない
  • 考えられる選択肢:
    • (a) tabindex: number | "" のように明確に「tabindexなし」を表す表現を数値と undefined 以外に作る
    • (b) tabindex: string として全部文字列で受けてしまう
  • (b) は型的に過剰に広いが、 (a) はかなり見慣れない型付けになり、一長一短
  • ここでは (b) を採ることにする

@yu-ogi yu-ogi merged commit 1bcaeff into main Oct 17, 2023
8 checks passed
@yu-ogi yu-ogi deleted the support-tabindex branch October 17, 2023 08:01
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