fireShortcut ignores the overlay a keydown comes from
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- java, typescript
- Lĩnh vực
- testing
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Java
- Star
- 1
- Fork
- 3
- Merge trung bình
- 2 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 24
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của vaadin/browserless-test
-
Rename MultiSelectComboBoxTester.selectItem(String...) to selectItems(String...)Có thể đã có người làm @totally-not-ai đã nhận 21 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
vaadin/browserless-test#291 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
(MultiSelect)ComboBoxTester add support for selectItemContaining(String)Có thể đã có người làm @totally-not-ai đã nhận 42 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
vaadin/browserless-test#270 · 3 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
vaadin/browserless-test#266 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
vaadin/browserless-test#123 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
SharedValueSignal.update loops forever in a multi-user application context testCó thể đã có người làm @totally-not-ai đã nhận 1 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
vaadin/browserless-test#335 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của vaadin/browserless-test
Issue tương tự
-
Links broken in documentationĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
pact-foundation/pact-plugins#125 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
opencollab/flexdock#28 · 1 bình luận ·
-
Page header disappearsĐang mởMVP
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
OpenConext/OpenConext-access#1145 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
yegor256/jping#122 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày