aboutsummaryrefslogtreecommitdiff
path: root/js/src
diff options
context:
space:
mode:
authorMatheus Azzi <[email protected]>2016-10-15 22:55:48 -0300
committerBardi Harborow <[email protected]>2016-12-23 17:55:40 +1100
commitdab6a41e049de64653c8b91c28acf212137b0452 (patch)
tree081661ac6c7bad1d2a50e9533821e5f0be6f657a /js/src
parent1d6cdb65b32f918fc497953adf02b60e26ea3fec (diff)
downloadbootstrap-dab6a41e049de64653c8b91c28acf212137b0452.tar.xz
bootstrap-dab6a41e049de64653c8b91c28acf212137b0452.zip
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')
-rw-r--r--js/src/carousel.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/js/src/carousel.js b/js/src/carousel.js
index 304d0160f..78f8eb468 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: