Setup
Rancher v2.14.0
Dashboard v2.14.0
Describe the bug
Found while fixing rancher/qa-tasks#2270
There's a workaround in place to test downloading the diagnostics package JSON. We're using cy.on('uncaught:exception') to ignore known failures due to AppModal.vue that always activates a focus-trap on modal-container-element, but in this e2e test diagnostic.spec.ts, the modal is being closed so quickly (right after clicking “download”) that the trap is still activating while the container has no tabbable elements. When focus-trap activates and can’t find any tabbable node inside its container, it throws:
“Your focus-trap must have at least one container with at least one tabbable node in it at all times.”
To Reproduce
Run diagnostic.spec.ts in CI.
Result
AppModal.vue is wiring the trap by watching a variable and then calling createFocusTrap(...).activate() on #modal-container-element, resulting in the test failure.
Expected Result
The modal container must be programmatically focusable and provide a fallbackFocus for focus-trap, so this error does not fire when tabbable controls are temporarily unavailable.
Setup
Rancher v2.14.0
Dashboard v2.14.0
Describe the bug
Found while fixing rancher/qa-tasks#2270
There's a workaround in place to test downloading the diagnostics package JSON. We're using
cy.on('uncaught:exception')to ignore known failures due toAppModal.vuethat always activates a focus-trap onmodal-container-element, but in this e2e testdiagnostic.spec.ts, the modal is being closed so quickly (right after clicking “download”) that the trap is still activating while the container has no tabbable elements. Whenfocus-trapactivates and can’t find any tabbable node inside its container, it throws:“Your focus-trap must have at least one container with at least one tabbable node in it at all times.”
To Reproduce
Run
diagnostic.spec.tsin CI.Result
AppModal.vueis wiring the trap by watching a variable and then callingcreateFocusTrap(...).activate()on#modal-container-element, resulting in the test failure.Expected Result
The modal container must be programmatically focusable and provide a
fallbackFocusforfocus-trap, so this error does not fire when tabbable controls are temporarily unavailable.