Skip to content

Commit 2c82c0c

Browse files
style: retain braces around keyboard listener guards
1 parent feab322 commit 2c82c0c

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎src/hooks/useAccessibility.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,14 @@ export default function useAccessibility({
7676
React.useEffect(() => {
7777
if (open) {
7878
const handleCapture = (event: KeyboardEvent) => {
79-
if (event.keyCode === ESC) handleKeyDown(event);
79+
if (event.keyCode === ESC) {
80+
handleKeyDown(event);
81+
}
8082
};
8183
const handleBubble = (event: KeyboardEvent) => {
82-
if (event.keyCode !== ESC) handleKeyDown(event);
84+
if (event.keyCode !== ESC) {
85+
handleKeyDown(event);
86+
}
8387
};
8488
window.addEventListener('keydown', handleCapture, true);
8589
window.addEventListener('keydown', handleBubble);

0 commit comments

Comments
 (0)