fireShortcut ignores the overlay a keydown comes from
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 30/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- java, typescript
- 領域
- testing
調査の方向性
Start with matchKeydown in Flow's Shortcut.ts to see how the browser scopes keydowns to open overlays, then with KeydownFilterSimulation and its unused checkOwnerScope. The origin of a keydown comes from FocusTracker, and the owner's overlay comes from ownerSelector in fireShortcut. Done when a shortcut in a non-modal Dialog or Popover fires only when the focus position matches the browser table in the issue, and existing tests are updated accordingly.
索引モデルが issue の本文から書いたものです。
説明
Problem
fireShortcut does not check where the keydown comes from. In the browser,
the shortcut filter (matchKeydown in Flow's Shortcut.ts) ignores a
keydown that does not originate from the popover/modal scope of the shortcut
owner: while a non-modal Dialog or a Popover is open, a keydown inside
it only reaches shortcuts owned inside it, and a keydown outside it only
reaches shortcuts owned outside it. KeydownFilterSimulation ignores
checkOwnerScope, so browserless fires every shortcut the server allows,
and a test can pass for a shortcut a real user cannot trigger.
Modal dialogs are not affected: the server makes the UI inert, so the
shortcuts outside the dialog are not notified in either case.
Raised in the review of #326. Not a regression of that PR: the old
simulation did not check the scope either.
Reproduction
A view with Alt+digit click shortcuts on buttons in the view ("main"), in a
modal Dialog ("modal"), in a non-modal Dialog ("nonmodal") and in a
Popover ("popover"), plus a shortcut listener owned by the UI ("ui"). Each
scenario presses all of them, in Chrome against Vaadin 25.4-SNAPSHOT, and
with fireShortcut:
| Scenario | Browser | Browserless | Same? |
|---|---|---|---|
| No overlay, focus in the view | main, popover, ui | main, popover, ui | yes |
Modal Dialog open, focus in it |
modal | modal | yes |
Non-modal Dialog open, focus in it |
nonmodal | main, nonmodal, popover, ui | no |
Non-modal Dialog open, focus in the view |
main, popover, ui | main, nonmodal, popover, ui | no |
Popover open, focus in it |
popover | main, popover, ui | no |
Popover open, focus in the view |
main, ui | main, popover, ui | no |
("popover" fires with the popover closed in both: its button is then not
inside an open overlay.)
Browserless fires the union, which no focus position in the browser
produces.
Proposed fix
Browserless already tracks focus with FocusTracker, so no new API is
needed:
- Take the origin of the keydown from the focused component. When nothing is
focused, use the active modal component if there is one, since the
browser traps focus there, and otherwise the top level. - In the keydown simulation, compare the nearest open overlay (
Dialog,
Popover) around the origin with the one around the shortcut owner,
found fromownerSelector. A shortcut owned by the UI requires the origin
to be at the top level.
A test then states where the user is, as in the browser:
test(fieldInDialog).focus() or any interaction with a component in the
overlay, followed by fireShortcut(...).
This changes what existing tests see: a test that fires a shortcut owned in
a non-modal dialog or popover without anything in it focused no longer
fires it.
- 主要言語
- Java
- スター
- 1
- フォーク
- 3
- 平均マージ
- 2日 1時間
- マージ済み PR(30日)
- 24
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
vaadin/browserless-test のほかの issue
-
Rename MultiSelectComboBoxTester.selectItem(String...) to selectItems(String...)対応中かも @totally-not-ai が 21 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
vaadin/browserless-test#291 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
(MultiSelect)ComboBoxTester add support for selectItemContaining(String)対応中かも @totally-not-ai が 42 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
vaadin/browserless-test#270 · コメント 3 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
vaadin/browserless-test#266 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
vaadin/browserless-test#123 ·
メンテナーはふだん 1 日以内に返信
-
SharedValueSignal.update loops forever in a multi-user application context test対応中かも @totally-not-ai が 1 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
vaadin/browserless-test#335 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
vaadin/browserless-test の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
pact-foundation/pact-plugins#125 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
opencollab/flexdock#28 · コメント 1 件 ·
-
MVP
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
OpenConext/OpenConext-access#1145 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
yegor256/jping#122 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
SAP/ai-sdk-java#1206 ·
メンテナーはふだん 1 日以内に返信