diff options
author | Matheus Azzi <matheuslazzi@gmail.com> | 2016-10-16 04:55:48 +0300 |
---|---|---|
committer | Bardi Harborow <bardi@bardiharborow.com> | 2016-12-23 09:55:40 +0300 |
commit | dab6a41e049de64653c8b91c28acf212137b0452 (patch) | |
tree | 081661ac6c7bad1d2a50e9533821e5f0be6f657a /js/src/carousel.js | |
parent | 1d6cdb65b32f918fc497953adf02b60e26ea3fec (diff) |
Carousel: Only prevents default for ARROW_LEFT and ARROW_RIGHT keys
Fixes 2 bugs:
1. All keydowns were being prevented. Because of that the user wasn't able to navigate in the whole page using ARROW_UP/ARROW_DOWN.
2. Even when is an input or textarea the keydowns were being prevented. Because of that the user wasn't able to type any text on these elements.
Diffstat (limited to 'js/src/carousel.js')
-rw-r--r-- | js/src/carousel.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/js/src/carousel.js b/js/src/carousel.js index 304d0160f6..78f8eb468b 100644 --- a/js/src/carousel.js +++ b/js/src/carousel.js @@ -245,9 +245,11 @@ const Carousel = (($) => { switch (event.which) { case ARROW_LEFT_KEYCODE: + event.preventDefault() this.prev() break case ARROW_RIGHT_KEYCODE: + event.preventDefault() this.next() break default: |