Add Escape key to close settings modal
This commit is contained in:
@@ -1,19 +1,3 @@
|
||||
## Task 17: UI Settings Modal - Close Settings Modal Via Overlay
|
||||
|
||||
**Suite:** `Robot.Ui.Settings Modal`
|
||||
**Test:** `Close Settings Modal Via Overlay`
|
||||
**Result:** FAIL
|
||||
**Error:** `TimeoutError: locator.click: Timeout 10000ms exceeded. waiting for locator('id=config-modal .modal-overlay')`
|
||||
|
||||
**Instructions:**
|
||||
- The test tries to click a `.modal-overlay` element inside `#config-modal`, but the element is not found.
|
||||
- Inspect the settings modal HTML structure in the frontend.
|
||||
- The overlay element may have a different class name (e.g., `.modal-backdrop`, `.overlay`) or may not exist as a separate element.
|
||||
- Update the locator in `tests/robot/ui/settings_modal.robot` to match the actual DOM structure.
|
||||
- If the overlay click-to-close behavior is missing, implement it in the frontend.
|
||||
|
||||
---
|
||||
|
||||
## Task 18: UI Settings Modal - Close Settings Modal Via Escape
|
||||
|
||||
**Suite:** `Robot.Ui.Settings Modal`
|
||||
|
||||
@@ -442,6 +442,13 @@ class AniWorldApp {
|
||||
this.hideConfigModal();
|
||||
});
|
||||
|
||||
document.addEventListener('keydown', (e) => {
|
||||
const modal = document.getElementById('config-modal');
|
||||
if (e.key === 'Escape' && modal && !modal.classList.contains('hidden')) {
|
||||
this.hideConfigModal();
|
||||
}
|
||||
});
|
||||
|
||||
// Scheduler configuration
|
||||
document.getElementById('scheduled-rescan-enabled').addEventListener('change', () => {
|
||||
this.toggleSchedulerTimeInput();
|
||||
|
||||
Reference in New Issue
Block a user