Tooltip in Table closes automatically for keyboard users

オープン
#10,333 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

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

  • #10363 @jsmitrah による — マージされずにクローズ

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
65/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
react, typescript

調査の方向性

リンクされた StackBlitz の再現手順から始め、Table のフォーカスパスと併せて Tooltip の useOverlayPosition の動作を調査します。Shift+Tab での再入場と Arrow Down によるナビゲーションを比較し、その後、フォーカスされた trigger が tooltip を開いたままにする一方で、通常のスクロールでは引き続き閉じることを確認します。

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

説明

Provide a general summary of the issue here

Tooltips within a Table component gets automatically closed immediately for keyboard users when moving focus back into the grid via Shift+Tab and in certain cases when navigating between cells.

🤔 Expected Behavior?

Tooltips should stay open when the trigger is focused

😯 Current Behavior

Tooltip is opened and then immediately closes again.

I think this is caused by scroll events. The Tooltip automatically closes on scroll (in useOverlayPosition) which is correct for regular scroll events. Tabbing back into the grid also results in scroll events (because the browser initially moves focus to the last focusable element which scrolls, then RAC moves focus and restores the scroll position), but they should be ignored somehow.

💁 Possible Solution

No response

🔦 Context

We're building our own Table component (because of different requirements) but plan to use the Tooltip component to show truncated content (for keyboard + mouse users, not needed for SR users and touch users can still resize the column / open the detail page). I stumbled across this problem in our own implementation but it's reproducible with the RAC table component.

🖥️ Steps to Reproduce

Open https://stackblitz.com/edit/goy7bobs?file=index.html (and make sure the preview window is wide enough so you can see the columns in the table)

Issue 1:

  1. Tab into the grid and move focus to the "..." menu button => Tooltip appears
  2. Press Tab (moves focus out if grid)
  3. Press Shift + Tab (moves focus back into grid)

Issue 2:

  1. Tab into the grid and move focus to the "..." menu button => Tooltip appears
  2. Press Arrow Down multiple times until new rows appear in the viewport
Version

[email protected]

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

Windows 11

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

主要言語
TypeScript
スター
16k
フォーク
1.6k
平均マージ
2日 19時間
マージ済み PR(30日)
41

環境構築

はじめの一歩

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

adobe/react-spectrum のほかの issue

adobe/react-spectrum の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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