fireShortcut ignores the overlay a keydown comes from
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 30/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- java, typescript
- Ambito
- testing
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Java
- Stelle
- 1
- Fork
- 3
- Merge medio
- 2g 1h
- PR unite (30g)
- 24
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di vaadin/browserless-test
-
Rename MultiSelectComboBoxTester.selectItem(String...) to selectItems(String...)Forse già presa @totally-not-ai l’ha presa 20 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
vaadin/browserless-test#291 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
(MultiSelect)ComboBoxTester add support for selectItemContaining(String)Forse già presa @totally-not-ai l’ha presa 42 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
vaadin/browserless-test#270 · 3 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
vaadin/browserless-test#266 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
vaadin/browserless-test#123 ·
I maintainer di solito rispondono entro 1 giorno
-
SharedValueSignal.update loops forever in a multi-user application context testForse già presa @totally-not-ai l’ha presa oggi. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
vaadin/browserless-test#335 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di vaadin/browserless-test
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
SAP/ai-sdk-java#1206 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue insight-module
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
sdlc-pro/spring-lens#606 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
apache/cloudstack#14719 ·
I maintainer di solito rispondono entro 1 giorno
-
quality-assurance
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Paul-Austin-Oswego-CSC480-HCI521/gift-app#252 ·
I maintainer di solito rispondono entro 1 giorno
-
backlog kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
TencentBlueKing/bk-job#4627 ·
I maintainer di solito rispondono entro 1 giorno