Skip to content

Commit 9253c30

Browse files
Add Project Escape Button Functionality
- When the add project overlay is displayed and the user uses the escape key it will close the overlay
1 parent 7b51f1d commit 9253c30

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/homeView.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ addProjectButton_el.addEventListener('click', () => {
1515
projectNameInput_el.focus();
1616
});
1717

18+
document.addEventListener('keydown', async (event) => {
19+
if (event.key === 'Escape' && addProjectOverlay_el.style.display === 'flex'){
20+
addProjectOverlay_el.style.display = 'none';
21+
}
22+
});
23+
1824
addProjectCloseButton_el.addEventListener('click', () => {
1925
removeErrorInput(projectNameInput_el);
2026
addProjectOverlay_el.style.display = 'none';

0 commit comments

Comments
 (0)