Skip to content

Commit 84ceb70

Browse files
committed
correcting md
1 parent 9e82805 commit 84ceb70

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

content/how-to/add_keyboard_navigation.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The task is to slide the panels left or right, depending on which cursor key is
1818

1919
As Mathieu’s slider is the primary focus of the page, we want the keyboard support to apply from anywhere on the page. And we’re only navigating left and right, which won’t interfere with scrolling up and down the page.
2020

21-
We need a keyboard event listener on the document.documentElement element as this is the best point for a catch all element (to work in all browsers). If an input element is focused, and you press a key, it fires the keypress event on the input element, then on all the parent elements, which eventually hits the body element, then thedocumentElement then the the window.
21+
We need a keyboard event listener on the document.documentElement element as this is the best point for a catch all element (to work in all browsers). If an input element is focused, and you press a key, it fires the keypress event on the input element, then on all the parent elements, which eventually hits the body element, then the documentElement then the the window.
2222

2323
Once we have our keyboard event listener, we need to determine whether the user pressed the left or right cursor key, and if they did trigger the effect.
2424

@@ -27,6 +27,7 @@ Triggering the effect is the trick. We’re doing this by triggering a click on
2727
##Capturing key events
2828

2929
Then a keyboard key is pressed the event break into three separate events, which fire in the following order:
30+
3031
- keydown
3132
- keypress
3233
- keyup

0 commit comments

Comments
 (0)